@aws-sdk/client-dataexchange 3.32.0 → 3.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/{dist/cjs → dist-cjs}/DataExchange.js +76 -2
  3. package/{dist/cjs → dist-cjs}/DataExchangeClient.js +8 -9
  4. package/{dist/cjs → dist-cjs}/commands/CancelJobCommand.js +2 -3
  5. package/{dist/cjs → dist-cjs}/commands/CreateDataSetCommand.js +2 -3
  6. package/dist-cjs/commands/CreateEventActionCommand.js +60 -0
  7. package/{dist/cjs → dist-cjs}/commands/CreateJobCommand.js +2 -3
  8. package/{dist/cjs → dist-cjs}/commands/CreateRevisionCommand.js +2 -3
  9. package/{dist/cjs → dist-cjs}/commands/DeleteAssetCommand.js +2 -3
  10. package/{dist/cjs → dist-cjs}/commands/DeleteDataSetCommand.js +2 -3
  11. package/dist-cjs/commands/DeleteEventActionCommand.js +60 -0
  12. package/{dist/cjs → dist-cjs}/commands/DeleteRevisionCommand.js +2 -3
  13. package/{dist/cjs → dist-cjs}/commands/GetAssetCommand.js +2 -3
  14. package/{dist/cjs → dist-cjs}/commands/GetDataSetCommand.js +2 -3
  15. package/dist-cjs/commands/GetEventActionCommand.js +60 -0
  16. package/{dist/cjs → dist-cjs}/commands/GetJobCommand.js +2 -3
  17. package/{dist/cjs → dist-cjs}/commands/GetRevisionCommand.js +2 -3
  18. package/{dist/cjs → dist-cjs}/commands/ListDataSetRevisionsCommand.js +2 -3
  19. package/{dist/cjs → dist-cjs}/commands/ListDataSetsCommand.js +2 -3
  20. package/dist-cjs/commands/ListEventActionsCommand.js +60 -0
  21. package/{dist/cjs → dist-cjs}/commands/ListJobsCommand.js +2 -3
  22. package/{dist/cjs → dist-cjs}/commands/ListRevisionAssetsCommand.js +2 -3
  23. package/{dist/cjs → dist-cjs}/commands/ListTagsForResourceCommand.js +2 -3
  24. package/{dist/cjs → dist-cjs}/commands/StartJobCommand.js +2 -3
  25. package/{dist/cjs → dist-cjs}/commands/TagResourceCommand.js +2 -3
  26. package/{dist/cjs → dist-cjs}/commands/UntagResourceCommand.js +2 -3
  27. package/{dist/cjs → dist-cjs}/commands/UpdateAssetCommand.js +2 -3
  28. package/{dist/cjs → dist-cjs}/commands/UpdateDataSetCommand.js +2 -3
  29. package/dist-cjs/commands/UpdateEventActionCommand.js +60 -0
  30. package/{dist/cjs → dist-cjs}/commands/UpdateRevisionCommand.js +2 -3
  31. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  32. package/{dist/cjs → dist-cjs}/index.js +6 -1
  33. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  34. package/{dist/cjs → dist-cjs}/models/models_0.js +156 -12
  35. package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
  36. package/{dist/cjs → dist-cjs}/pagination/ListDataSetRevisionsPaginator.js +1 -2
  37. package/{dist/cjs → dist-cjs}/pagination/ListDataSetsPaginator.js +1 -2
  38. package/dist-cjs/pagination/ListEventActionsPaginator.js +45 -0
  39. package/{dist/cjs → dist-cjs}/pagination/ListJobsPaginator.js +1 -2
  40. package/{dist/cjs → dist-cjs}/pagination/ListRevisionAssetsPaginator.js +1 -2
  41. package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +700 -28
  42. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +2 -2
  43. package/{dist/cjs → dist-cjs}/runtimeConfig.js +2 -2
  44. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -1
  45. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -2
  46. package/{dist/es → dist-es}/DataExchange.js +77 -6
  47. package/{dist/es → dist-es}/DataExchangeClient.js +2 -11
  48. package/{dist/es → dist-es}/commands/CancelJobCommand.js +4 -30
  49. package/{dist/es → dist-es}/commands/CreateDataSetCommand.js +4 -30
  50. package/dist-es/commands/CreateEventActionCommand.js +39 -0
  51. package/{dist/es → dist-es}/commands/CreateJobCommand.js +4 -30
  52. package/{dist/es → dist-es}/commands/CreateRevisionCommand.js +4 -30
  53. package/{dist/es → dist-es}/commands/DeleteAssetCommand.js +4 -30
  54. package/{dist/es → dist-es}/commands/DeleteDataSetCommand.js +4 -30
  55. package/dist-es/commands/DeleteEventActionCommand.js +39 -0
  56. package/{dist/es → dist-es}/commands/DeleteRevisionCommand.js +4 -30
  57. package/{dist/es → dist-es}/commands/GetAssetCommand.js +4 -30
  58. package/{dist/es → dist-es}/commands/GetDataSetCommand.js +4 -30
  59. package/dist-es/commands/GetEventActionCommand.js +39 -0
  60. package/{dist/es → dist-es}/commands/GetJobCommand.js +4 -30
  61. package/{dist/es → dist-es}/commands/GetRevisionCommand.js +4 -30
  62. package/{dist/es → dist-es}/commands/ListDataSetRevisionsCommand.js +4 -30
  63. package/{dist/es → dist-es}/commands/ListDataSetsCommand.js +4 -30
  64. package/dist-es/commands/ListEventActionsCommand.js +39 -0
  65. package/{dist/es → dist-es}/commands/ListJobsCommand.js +4 -30
  66. package/{dist/es → dist-es}/commands/ListRevisionAssetsCommand.js +4 -30
  67. package/{dist/es → dist-es}/commands/ListTagsForResourceCommand.js +4 -30
  68. package/{dist/es → dist-es}/commands/StartJobCommand.js +4 -30
  69. package/{dist/es → dist-es}/commands/TagResourceCommand.js +4 -30
  70. package/{dist/es → dist-es}/commands/UntagResourceCommand.js +4 -30
  71. package/{dist/es → dist-es}/commands/UpdateAssetCommand.js +4 -30
  72. package/{dist/es → dist-es}/commands/UpdateDataSetCommand.js +4 -30
  73. package/dist-es/commands/UpdateEventActionCommand.js +39 -0
  74. package/{dist/es → dist-es}/commands/UpdateRevisionCommand.js +4 -30
  75. package/{dist/es → dist-es}/endpoints.js +1 -2
  76. package/{dist/es → dist-es}/index.js +6 -1
  77. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  78. package/{dist/es → dist-es}/models/models_0.js +79 -223
  79. package/dist-es/pagination/Interfaces.js +1 -0
  80. package/{dist/es → dist-es}/pagination/ListDataSetRevisionsPaginator.js +17 -30
  81. package/{dist/es → dist-es}/pagination/ListDataSetsPaginator.js +17 -30
  82. package/dist-es/pagination/ListEventActionsPaginator.js +74 -0
  83. package/{dist/es → dist-es}/pagination/ListJobsPaginator.js +17 -30
  84. package/{dist/es → dist-es}/pagination/ListRevisionAssetsPaginator.js +17 -30
  85. package/{dist/es → dist-es}/protocols/Aws_restJson1.js +1315 -577
  86. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  87. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  88. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  89. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  90. package/{dist/types → dist-types}/DataExchange.d.ts +37 -2
  91. package/{dist/types → dist-types}/DataExchangeClient.d.ts +15 -10
  92. package/{dist/types → dist-types}/commands/CancelJobCommand.d.ts +2 -2
  93. package/{dist/types → dist-types}/commands/CreateDataSetCommand.d.ts +2 -2
  94. package/dist-types/commands/CreateEventActionCommand.d.ts +35 -0
  95. package/{dist/types → dist-types}/commands/CreateJobCommand.d.ts +2 -2
  96. package/{dist/types → dist-types}/commands/CreateRevisionCommand.d.ts +2 -2
  97. package/{dist/types → dist-types}/commands/DeleteAssetCommand.d.ts +2 -2
  98. package/{dist/types → dist-types}/commands/DeleteDataSetCommand.d.ts +2 -2
  99. package/dist-types/commands/DeleteEventActionCommand.d.ts +35 -0
  100. package/{dist/types → dist-types}/commands/DeleteRevisionCommand.d.ts +2 -2
  101. package/{dist/types → dist-types}/commands/GetAssetCommand.d.ts +2 -2
  102. package/{dist/types → dist-types}/commands/GetDataSetCommand.d.ts +2 -2
  103. package/dist-types/commands/GetEventActionCommand.d.ts +35 -0
  104. package/{dist/types → dist-types}/commands/GetJobCommand.d.ts +2 -2
  105. package/{dist/types → dist-types}/commands/GetRevisionCommand.d.ts +2 -2
  106. package/{dist/types → dist-types}/commands/ListDataSetRevisionsCommand.d.ts +2 -2
  107. package/{dist/types → dist-types}/commands/ListDataSetsCommand.d.ts +2 -2
  108. package/dist-types/commands/ListEventActionsCommand.d.ts +35 -0
  109. package/{dist/types → dist-types}/commands/ListJobsCommand.d.ts +2 -2
  110. package/{dist/types → dist-types}/commands/ListRevisionAssetsCommand.d.ts +2 -2
  111. package/{dist/types → dist-types}/commands/ListTagsForResourceCommand.d.ts +2 -2
  112. package/{dist/types → dist-types}/commands/StartJobCommand.d.ts +2 -2
  113. package/{dist/types → dist-types}/commands/TagResourceCommand.d.ts +2 -2
  114. package/{dist/types → dist-types}/commands/UntagResourceCommand.d.ts +2 -2
  115. package/{dist/types → dist-types}/commands/UpdateAssetCommand.d.ts +2 -2
  116. package/{dist/types → dist-types}/commands/UpdateDataSetCommand.d.ts +2 -2
  117. package/dist-types/commands/UpdateEventActionCommand.d.ts +35 -0
  118. package/{dist/types → dist-types}/commands/UpdateRevisionCommand.d.ts +2 -2
  119. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  120. package/{dist/types → dist-types}/index.d.ts +6 -0
  121. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  122. package/{dist/types → dist-types}/models/models_0.d.ts +324 -11
  123. package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
  124. package/{dist/types → dist-types}/pagination/ListDataSetRevisionsPaginator.d.ts +1 -1
  125. package/{dist/types → dist-types}/pagination/ListDataSetsPaginator.d.ts +1 -1
  126. package/dist-types/pagination/ListEventActionsPaginator.d.ts +4 -0
  127. package/{dist/types → dist-types}/pagination/ListJobsPaginator.d.ts +1 -1
  128. package/{dist/types → dist-types}/pagination/ListRevisionAssetsPaginator.d.ts +1 -1
  129. package/{dist/types/ts3.4 → dist-types}/protocols/Aws_restJson1.d.ts +83 -68
  130. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +1 -0
  131. package/{dist/types/ts3.4 → dist-types}/runtimeConfig.d.ts +37 -36
  132. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +1 -0
  133. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  134. package/{dist/types → dist-types}/ts3.4/DataExchange.d.ts +37 -2
  135. package/{dist/types → dist-types}/ts3.4/DataExchangeClient.d.ts +15 -10
  136. package/{dist/types → dist-types}/ts3.4/commands/CancelJobCommand.d.ts +2 -2
  137. package/{dist/types → dist-types}/ts3.4/commands/CreateDataSetCommand.d.ts +2 -2
  138. package/dist-types/ts3.4/commands/CreateEventActionCommand.d.ts +35 -0
  139. package/{dist/types → dist-types}/ts3.4/commands/CreateJobCommand.d.ts +2 -2
  140. package/{dist/types → dist-types}/ts3.4/commands/CreateRevisionCommand.d.ts +2 -2
  141. package/{dist/types → dist-types}/ts3.4/commands/DeleteAssetCommand.d.ts +2 -2
  142. package/{dist/types → dist-types}/ts3.4/commands/DeleteDataSetCommand.d.ts +2 -2
  143. package/dist-types/ts3.4/commands/DeleteEventActionCommand.d.ts +35 -0
  144. package/{dist/types → dist-types}/ts3.4/commands/DeleteRevisionCommand.d.ts +2 -2
  145. package/{dist/types → dist-types}/ts3.4/commands/GetAssetCommand.d.ts +2 -2
  146. package/{dist/types → dist-types}/ts3.4/commands/GetDataSetCommand.d.ts +2 -2
  147. package/dist-types/ts3.4/commands/GetEventActionCommand.d.ts +35 -0
  148. package/{dist/types → dist-types}/ts3.4/commands/GetJobCommand.d.ts +2 -2
  149. package/{dist/types → dist-types}/ts3.4/commands/GetRevisionCommand.d.ts +2 -2
  150. package/{dist/types → dist-types}/ts3.4/commands/ListDataSetRevisionsCommand.d.ts +2 -2
  151. package/{dist/types → dist-types}/ts3.4/commands/ListDataSetsCommand.d.ts +2 -2
  152. package/dist-types/ts3.4/commands/ListEventActionsCommand.d.ts +35 -0
  153. package/{dist/types → dist-types}/ts3.4/commands/ListJobsCommand.d.ts +2 -2
  154. package/{dist/types → dist-types}/ts3.4/commands/ListRevisionAssetsCommand.d.ts +2 -2
  155. package/{dist/types → dist-types}/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -2
  156. package/{dist/types → dist-types}/ts3.4/commands/StartJobCommand.d.ts +2 -2
  157. package/{dist/types → dist-types}/ts3.4/commands/TagResourceCommand.d.ts +2 -2
  158. package/{dist/types → dist-types}/ts3.4/commands/UntagResourceCommand.d.ts +2 -2
  159. package/{dist/types → dist-types}/ts3.4/commands/UpdateAssetCommand.d.ts +2 -2
  160. package/{dist/types → dist-types}/ts3.4/commands/UpdateDataSetCommand.d.ts +2 -2
  161. package/dist-types/ts3.4/commands/UpdateEventActionCommand.d.ts +35 -0
  162. package/{dist/types → dist-types}/ts3.4/commands/UpdateRevisionCommand.d.ts +2 -2
  163. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  164. package/{dist/types → dist-types}/ts3.4/index.d.ts +6 -0
  165. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  166. package/{dist/types → dist-types}/ts3.4/models/models_0.d.ts +324 -11
  167. package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
  168. package/{dist/types → dist-types}/ts3.4/pagination/ListDataSetRevisionsPaginator.d.ts +1 -1
  169. package/{dist/types → dist-types}/ts3.4/pagination/ListDataSetsPaginator.d.ts +1 -1
  170. package/dist-types/ts3.4/pagination/ListEventActionsPaginator.d.ts +4 -0
  171. package/{dist/types → dist-types}/ts3.4/pagination/ListJobsPaginator.d.ts +1 -1
  172. package/{dist/types → dist-types}/ts3.4/pagination/ListRevisionAssetsPaginator.d.ts +1 -1
  173. package/{dist/types → dist-types/ts3.4}/protocols/Aws_restJson1.d.ts +83 -68
  174. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -0
  175. package/{dist/types → dist-types/ts3.4}/runtimeConfig.d.ts +37 -36
  176. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -0
  177. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +0 -0
  178. package/package.json +52 -49
  179. package/DataExchange.ts +0 -708
  180. package/DataExchangeClient.ts +0 -307
  181. package/commands/CancelJobCommand.ts +0 -94
  182. package/commands/CreateDataSetCommand.ts +0 -94
  183. package/commands/CreateJobCommand.ts +0 -94
  184. package/commands/CreateRevisionCommand.ts +0 -94
  185. package/commands/DeleteAssetCommand.ts +0 -94
  186. package/commands/DeleteDataSetCommand.ts +0 -94
  187. package/commands/DeleteRevisionCommand.ts +0 -94
  188. package/commands/GetAssetCommand.ts +0 -94
  189. package/commands/GetDataSetCommand.ts +0 -94
  190. package/commands/GetJobCommand.ts +0 -87
  191. package/commands/GetRevisionCommand.ts +0 -94
  192. package/commands/ListDataSetRevisionsCommand.ts +0 -94
  193. package/commands/ListDataSetsCommand.ts +0 -94
  194. package/commands/ListJobsCommand.ts +0 -94
  195. package/commands/ListRevisionAssetsCommand.ts +0 -94
  196. package/commands/ListTagsForResourceCommand.ts +0 -94
  197. package/commands/StartJobCommand.ts +0 -94
  198. package/commands/TagResourceCommand.ts +0 -94
  199. package/commands/UntagResourceCommand.ts +0 -94
  200. package/commands/UpdateAssetCommand.ts +0 -94
  201. package/commands/UpdateDataSetCommand.ts +0 -94
  202. package/commands/UpdateRevisionCommand.ts +0 -94
  203. package/dist/cjs/DataExchange.js.map +0 -1
  204. package/dist/cjs/DataExchangeClient.js.map +0 -1
  205. package/dist/cjs/commands/CancelJobCommand.js.map +0 -1
  206. package/dist/cjs/commands/CreateDataSetCommand.js.map +0 -1
  207. package/dist/cjs/commands/CreateJobCommand.js.map +0 -1
  208. package/dist/cjs/commands/CreateRevisionCommand.js.map +0 -1
  209. package/dist/cjs/commands/DeleteAssetCommand.js.map +0 -1
  210. package/dist/cjs/commands/DeleteDataSetCommand.js.map +0 -1
  211. package/dist/cjs/commands/DeleteRevisionCommand.js.map +0 -1
  212. package/dist/cjs/commands/GetAssetCommand.js.map +0 -1
  213. package/dist/cjs/commands/GetDataSetCommand.js.map +0 -1
  214. package/dist/cjs/commands/GetJobCommand.js.map +0 -1
  215. package/dist/cjs/commands/GetRevisionCommand.js.map +0 -1
  216. package/dist/cjs/commands/ListDataSetRevisionsCommand.js.map +0 -1
  217. package/dist/cjs/commands/ListDataSetsCommand.js.map +0 -1
  218. package/dist/cjs/commands/ListJobsCommand.js.map +0 -1
  219. package/dist/cjs/commands/ListRevisionAssetsCommand.js.map +0 -1
  220. package/dist/cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  221. package/dist/cjs/commands/StartJobCommand.js.map +0 -1
  222. package/dist/cjs/commands/TagResourceCommand.js.map +0 -1
  223. package/dist/cjs/commands/UntagResourceCommand.js.map +0 -1
  224. package/dist/cjs/commands/UpdateAssetCommand.js.map +0 -1
  225. package/dist/cjs/commands/UpdateDataSetCommand.js.map +0 -1
  226. package/dist/cjs/commands/UpdateRevisionCommand.js.map +0 -1
  227. package/dist/cjs/endpoints.js.map +0 -1
  228. package/dist/cjs/index.js.map +0 -1
  229. package/dist/cjs/models/index.js.map +0 -1
  230. package/dist/cjs/models/models_0.js.map +0 -1
  231. package/dist/cjs/package.json +0 -91
  232. package/dist/cjs/pagination/Interfaces.js.map +0 -1
  233. package/dist/cjs/pagination/ListDataSetRevisionsPaginator.js.map +0 -1
  234. package/dist/cjs/pagination/ListDataSetsPaginator.js.map +0 -1
  235. package/dist/cjs/pagination/ListJobsPaginator.js.map +0 -1
  236. package/dist/cjs/pagination/ListRevisionAssetsPaginator.js.map +0 -1
  237. package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
  238. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  239. package/dist/cjs/runtimeConfig.js.map +0 -1
  240. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  241. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  242. package/dist/es/DataExchange.js.map +0 -1
  243. package/dist/es/DataExchangeClient.js.map +0 -1
  244. package/dist/es/commands/CancelJobCommand.js.map +0 -1
  245. package/dist/es/commands/CreateDataSetCommand.js.map +0 -1
  246. package/dist/es/commands/CreateJobCommand.js.map +0 -1
  247. package/dist/es/commands/CreateRevisionCommand.js.map +0 -1
  248. package/dist/es/commands/DeleteAssetCommand.js.map +0 -1
  249. package/dist/es/commands/DeleteDataSetCommand.js.map +0 -1
  250. package/dist/es/commands/DeleteRevisionCommand.js.map +0 -1
  251. package/dist/es/commands/GetAssetCommand.js.map +0 -1
  252. package/dist/es/commands/GetDataSetCommand.js.map +0 -1
  253. package/dist/es/commands/GetJobCommand.js.map +0 -1
  254. package/dist/es/commands/GetRevisionCommand.js.map +0 -1
  255. package/dist/es/commands/ListDataSetRevisionsCommand.js.map +0 -1
  256. package/dist/es/commands/ListDataSetsCommand.js.map +0 -1
  257. package/dist/es/commands/ListJobsCommand.js.map +0 -1
  258. package/dist/es/commands/ListRevisionAssetsCommand.js.map +0 -1
  259. package/dist/es/commands/ListTagsForResourceCommand.js.map +0 -1
  260. package/dist/es/commands/StartJobCommand.js.map +0 -1
  261. package/dist/es/commands/TagResourceCommand.js.map +0 -1
  262. package/dist/es/commands/UntagResourceCommand.js.map +0 -1
  263. package/dist/es/commands/UpdateAssetCommand.js.map +0 -1
  264. package/dist/es/commands/UpdateDataSetCommand.js.map +0 -1
  265. package/dist/es/commands/UpdateRevisionCommand.js.map +0 -1
  266. package/dist/es/endpoints.js.map +0 -1
  267. package/dist/es/index.js.map +0 -1
  268. package/dist/es/models/index.js +0 -2
  269. package/dist/es/models/index.js.map +0 -1
  270. package/dist/es/models/models_0.js.map +0 -1
  271. package/dist/es/package.json +0 -91
  272. package/dist/es/pagination/Interfaces.js +0 -2
  273. package/dist/es/pagination/Interfaces.js.map +0 -1
  274. package/dist/es/pagination/ListDataSetRevisionsPaginator.js.map +0 -1
  275. package/dist/es/pagination/ListDataSetsPaginator.js.map +0 -1
  276. package/dist/es/pagination/ListJobsPaginator.js.map +0 -1
  277. package/dist/es/pagination/ListRevisionAssetsPaginator.js.map +0 -1
  278. package/dist/es/protocols/Aws_restJson1.js.map +0 -1
  279. package/dist/es/runtimeConfig.browser.js.map +0 -1
  280. package/dist/es/runtimeConfig.js.map +0 -1
  281. package/dist/es/runtimeConfig.native.js.map +0 -1
  282. package/dist/es/runtimeConfig.shared.js.map +0 -1
  283. package/endpoints.ts +0 -57
  284. package/index.ts +0 -30
  285. package/jest.config.js +0 -4
  286. package/models/models_0.ts +0 -2351
  287. package/pagination/Interfaces.ts +0 -7
  288. package/pagination/ListDataSetRevisionsPaginator.ts +0 -58
  289. package/pagination/ListDataSetsPaginator.ts +0 -58
  290. package/pagination/ListJobsPaginator.ts +0 -54
  291. package/pagination/ListRevisionAssetsPaginator.ts +0 -58
  292. package/protocols/Aws_restJson1.ts +0 -3750
  293. package/runtimeConfig.browser.ts +0 -40
  294. package/runtimeConfig.native.ts +0 -16
  295. package/runtimeConfig.shared.ts +0 -16
  296. package/runtimeConfig.ts +0 -45
  297. package/tsconfig.es.json +0 -12
  298. package/tsconfig.json +0 -32
@@ -1,3750 +0,0 @@
1
- import { CancelJobCommandInput, CancelJobCommandOutput } from "../commands/CancelJobCommand";
2
- import { CreateDataSetCommandInput, CreateDataSetCommandOutput } from "../commands/CreateDataSetCommand";
3
- import { CreateJobCommandInput, CreateJobCommandOutput } from "../commands/CreateJobCommand";
4
- import { CreateRevisionCommandInput, CreateRevisionCommandOutput } from "../commands/CreateRevisionCommand";
5
- import { DeleteAssetCommandInput, DeleteAssetCommandOutput } from "../commands/DeleteAssetCommand";
6
- import { DeleteDataSetCommandInput, DeleteDataSetCommandOutput } from "../commands/DeleteDataSetCommand";
7
- import { DeleteRevisionCommandInput, DeleteRevisionCommandOutput } from "../commands/DeleteRevisionCommand";
8
- import { GetAssetCommandInput, GetAssetCommandOutput } from "../commands/GetAssetCommand";
9
- import { GetDataSetCommandInput, GetDataSetCommandOutput } from "../commands/GetDataSetCommand";
10
- import { GetJobCommandInput, GetJobCommandOutput } from "../commands/GetJobCommand";
11
- import { GetRevisionCommandInput, GetRevisionCommandOutput } from "../commands/GetRevisionCommand";
12
- import {
13
- ListDataSetRevisionsCommandInput,
14
- ListDataSetRevisionsCommandOutput,
15
- } from "../commands/ListDataSetRevisionsCommand";
16
- import { ListDataSetsCommandInput, ListDataSetsCommandOutput } from "../commands/ListDataSetsCommand";
17
- import { ListJobsCommandInput, ListJobsCommandOutput } from "../commands/ListJobsCommand";
18
- import { ListRevisionAssetsCommandInput, ListRevisionAssetsCommandOutput } from "../commands/ListRevisionAssetsCommand";
19
- import {
20
- ListTagsForResourceCommandInput,
21
- ListTagsForResourceCommandOutput,
22
- } from "../commands/ListTagsForResourceCommand";
23
- import { StartJobCommandInput, StartJobCommandOutput } from "../commands/StartJobCommand";
24
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
25
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
26
- import { UpdateAssetCommandInput, UpdateAssetCommandOutput } from "../commands/UpdateAssetCommand";
27
- import { UpdateDataSetCommandInput, UpdateDataSetCommandOutput } from "../commands/UpdateDataSetCommand";
28
- import { UpdateRevisionCommandInput, UpdateRevisionCommandOutput } from "../commands/UpdateRevisionCommand";
29
- import {
30
- AccessDeniedException,
31
- AssetDestinationEntry,
32
- AssetDetails,
33
- AssetEntry,
34
- AssetSourceEntry,
35
- ConflictException,
36
- DataSetEntry,
37
- Details,
38
- ExportAssetToSignedUrlRequestDetails,
39
- ExportAssetToSignedUrlResponseDetails,
40
- ExportAssetsToS3RequestDetails,
41
- ExportAssetsToS3ResponseDetails,
42
- ExportRevisionsToS3RequestDetails,
43
- ExportRevisionsToS3ResponseDetails,
44
- ExportServerSideEncryption,
45
- ImportAssetFromSignedUrlJobErrorDetails,
46
- ImportAssetFromSignedUrlRequestDetails,
47
- ImportAssetFromSignedUrlResponseDetails,
48
- ImportAssetsFromS3RequestDetails,
49
- ImportAssetsFromS3ResponseDetails,
50
- InternalServerException,
51
- JobEntry,
52
- JobError,
53
- OriginDetails,
54
- RequestDetails,
55
- ResourceNotFoundException,
56
- ResponseDetails,
57
- RevisionDestinationEntry,
58
- RevisionEntry,
59
- S3SnapshotAsset,
60
- ServiceLimitExceededException,
61
- ThrottlingException,
62
- ValidationException,
63
- } from "../models/models_0";
64
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
65
- import {
66
- expectBoolean as __expectBoolean,
67
- expectNonNull as __expectNonNull,
68
- expectObject as __expectObject,
69
- expectString as __expectString,
70
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
71
- limitedParseDouble as __limitedParseDouble,
72
- parseRfc3339DateTime as __parseRfc3339DateTime,
73
- } from "@aws-sdk/smithy-client";
74
- import {
75
- Endpoint as __Endpoint,
76
- MetadataBearer as __MetadataBearer,
77
- ResponseMetadata as __ResponseMetadata,
78
- SerdeContext as __SerdeContext,
79
- SmithyException as __SmithyException,
80
- } from "@aws-sdk/types";
81
-
82
- export const serializeAws_restJson1CancelJobCommand = async (
83
- input: CancelJobCommandInput,
84
- context: __SerdeContext
85
- ): Promise<__HttpRequest> => {
86
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
87
- const headers: any = {};
88
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/jobs/{JobId}";
89
- if (input.JobId !== undefined) {
90
- const labelValue: string = input.JobId;
91
- if (labelValue.length <= 0) {
92
- throw new Error("Empty value provided for input HTTP label: JobId.");
93
- }
94
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
95
- } else {
96
- throw new Error("No value provided for input HTTP label: JobId.");
97
- }
98
- let body: any;
99
- return new __HttpRequest({
100
- protocol,
101
- hostname,
102
- port,
103
- method: "DELETE",
104
- headers,
105
- path: resolvedPath,
106
- body,
107
- });
108
- };
109
-
110
- export const serializeAws_restJson1CreateDataSetCommand = async (
111
- input: CreateDataSetCommandInput,
112
- context: __SerdeContext
113
- ): Promise<__HttpRequest> => {
114
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
115
- const headers: any = {
116
- "content-type": "application/json",
117
- };
118
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/data-sets";
119
- let body: any;
120
- body = JSON.stringify({
121
- ...(input.AssetType !== undefined && input.AssetType !== null && { AssetType: input.AssetType }),
122
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
123
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
124
- ...(input.Tags !== undefined &&
125
- input.Tags !== null && { Tags: serializeAws_restJson1MapOf__string(input.Tags, context) }),
126
- });
127
- return new __HttpRequest({
128
- protocol,
129
- hostname,
130
- port,
131
- method: "POST",
132
- headers,
133
- path: resolvedPath,
134
- body,
135
- });
136
- };
137
-
138
- export const serializeAws_restJson1CreateJobCommand = async (
139
- input: CreateJobCommandInput,
140
- context: __SerdeContext
141
- ): Promise<__HttpRequest> => {
142
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
143
- const headers: any = {
144
- "content-type": "application/json",
145
- };
146
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/jobs";
147
- let body: any;
148
- body = JSON.stringify({
149
- ...(input.Details !== undefined &&
150
- input.Details !== null && { Details: serializeAws_restJson1RequestDetails(input.Details, context) }),
151
- ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }),
152
- });
153
- return new __HttpRequest({
154
- protocol,
155
- hostname,
156
- port,
157
- method: "POST",
158
- headers,
159
- path: resolvedPath,
160
- body,
161
- });
162
- };
163
-
164
- export const serializeAws_restJson1CreateRevisionCommand = async (
165
- input: CreateRevisionCommandInput,
166
- context: __SerdeContext
167
- ): Promise<__HttpRequest> => {
168
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
169
- const headers: any = {
170
- "content-type": "application/json",
171
- };
172
- let resolvedPath =
173
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/data-sets/{DataSetId}/revisions";
174
- if (input.DataSetId !== undefined) {
175
- const labelValue: string = input.DataSetId;
176
- if (labelValue.length <= 0) {
177
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
178
- }
179
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
180
- } else {
181
- throw new Error("No value provided for input HTTP label: DataSetId.");
182
- }
183
- let body: any;
184
- body = JSON.stringify({
185
- ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }),
186
- ...(input.Tags !== undefined &&
187
- input.Tags !== null && { Tags: serializeAws_restJson1MapOf__string(input.Tags, context) }),
188
- });
189
- return new __HttpRequest({
190
- protocol,
191
- hostname,
192
- port,
193
- method: "POST",
194
- headers,
195
- path: resolvedPath,
196
- body,
197
- });
198
- };
199
-
200
- export const serializeAws_restJson1DeleteAssetCommand = async (
201
- input: DeleteAssetCommandInput,
202
- context: __SerdeContext
203
- ): Promise<__HttpRequest> => {
204
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
205
- const headers: any = {};
206
- let resolvedPath =
207
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
208
- "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}";
209
- if (input.AssetId !== undefined) {
210
- const labelValue: string = input.AssetId;
211
- if (labelValue.length <= 0) {
212
- throw new Error("Empty value provided for input HTTP label: AssetId.");
213
- }
214
- resolvedPath = resolvedPath.replace("{AssetId}", __extendedEncodeURIComponent(labelValue));
215
- } else {
216
- throw new Error("No value provided for input HTTP label: AssetId.");
217
- }
218
- if (input.DataSetId !== undefined) {
219
- const labelValue: string = input.DataSetId;
220
- if (labelValue.length <= 0) {
221
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
222
- }
223
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
224
- } else {
225
- throw new Error("No value provided for input HTTP label: DataSetId.");
226
- }
227
- if (input.RevisionId !== undefined) {
228
- const labelValue: string = input.RevisionId;
229
- if (labelValue.length <= 0) {
230
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
231
- }
232
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
233
- } else {
234
- throw new Error("No value provided for input HTTP label: RevisionId.");
235
- }
236
- let body: any;
237
- return new __HttpRequest({
238
- protocol,
239
- hostname,
240
- port,
241
- method: "DELETE",
242
- headers,
243
- path: resolvedPath,
244
- body,
245
- });
246
- };
247
-
248
- export const serializeAws_restJson1DeleteDataSetCommand = async (
249
- input: DeleteDataSetCommandInput,
250
- context: __SerdeContext
251
- ): Promise<__HttpRequest> => {
252
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
253
- const headers: any = {};
254
- let resolvedPath =
255
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/data-sets/{DataSetId}";
256
- if (input.DataSetId !== undefined) {
257
- const labelValue: string = input.DataSetId;
258
- if (labelValue.length <= 0) {
259
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
260
- }
261
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
262
- } else {
263
- throw new Error("No value provided for input HTTP label: DataSetId.");
264
- }
265
- let body: any;
266
- return new __HttpRequest({
267
- protocol,
268
- hostname,
269
- port,
270
- method: "DELETE",
271
- headers,
272
- path: resolvedPath,
273
- body,
274
- });
275
- };
276
-
277
- export const serializeAws_restJson1DeleteRevisionCommand = async (
278
- input: DeleteRevisionCommandInput,
279
- context: __SerdeContext
280
- ): Promise<__HttpRequest> => {
281
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
282
- const headers: any = {};
283
- let resolvedPath =
284
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
285
- "/v1/data-sets/{DataSetId}/revisions/{RevisionId}";
286
- if (input.DataSetId !== undefined) {
287
- const labelValue: string = input.DataSetId;
288
- if (labelValue.length <= 0) {
289
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
290
- }
291
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
292
- } else {
293
- throw new Error("No value provided for input HTTP label: DataSetId.");
294
- }
295
- if (input.RevisionId !== undefined) {
296
- const labelValue: string = input.RevisionId;
297
- if (labelValue.length <= 0) {
298
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
299
- }
300
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
301
- } else {
302
- throw new Error("No value provided for input HTTP label: RevisionId.");
303
- }
304
- let body: any;
305
- return new __HttpRequest({
306
- protocol,
307
- hostname,
308
- port,
309
- method: "DELETE",
310
- headers,
311
- path: resolvedPath,
312
- body,
313
- });
314
- };
315
-
316
- export const serializeAws_restJson1GetAssetCommand = async (
317
- input: GetAssetCommandInput,
318
- context: __SerdeContext
319
- ): Promise<__HttpRequest> => {
320
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
321
- const headers: any = {};
322
- let resolvedPath =
323
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
324
- "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}";
325
- if (input.AssetId !== undefined) {
326
- const labelValue: string = input.AssetId;
327
- if (labelValue.length <= 0) {
328
- throw new Error("Empty value provided for input HTTP label: AssetId.");
329
- }
330
- resolvedPath = resolvedPath.replace("{AssetId}", __extendedEncodeURIComponent(labelValue));
331
- } else {
332
- throw new Error("No value provided for input HTTP label: AssetId.");
333
- }
334
- if (input.DataSetId !== undefined) {
335
- const labelValue: string = input.DataSetId;
336
- if (labelValue.length <= 0) {
337
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
338
- }
339
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
340
- } else {
341
- throw new Error("No value provided for input HTTP label: DataSetId.");
342
- }
343
- if (input.RevisionId !== undefined) {
344
- const labelValue: string = input.RevisionId;
345
- if (labelValue.length <= 0) {
346
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
347
- }
348
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
349
- } else {
350
- throw new Error("No value provided for input HTTP label: RevisionId.");
351
- }
352
- let body: any;
353
- return new __HttpRequest({
354
- protocol,
355
- hostname,
356
- port,
357
- method: "GET",
358
- headers,
359
- path: resolvedPath,
360
- body,
361
- });
362
- };
363
-
364
- export const serializeAws_restJson1GetDataSetCommand = async (
365
- input: GetDataSetCommandInput,
366
- context: __SerdeContext
367
- ): Promise<__HttpRequest> => {
368
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
369
- const headers: any = {};
370
- let resolvedPath =
371
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/data-sets/{DataSetId}";
372
- if (input.DataSetId !== undefined) {
373
- const labelValue: string = input.DataSetId;
374
- if (labelValue.length <= 0) {
375
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
376
- }
377
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
378
- } else {
379
- throw new Error("No value provided for input HTTP label: DataSetId.");
380
- }
381
- let body: any;
382
- return new __HttpRequest({
383
- protocol,
384
- hostname,
385
- port,
386
- method: "GET",
387
- headers,
388
- path: resolvedPath,
389
- body,
390
- });
391
- };
392
-
393
- export const serializeAws_restJson1GetJobCommand = async (
394
- input: GetJobCommandInput,
395
- context: __SerdeContext
396
- ): Promise<__HttpRequest> => {
397
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
398
- const headers: any = {};
399
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/jobs/{JobId}";
400
- if (input.JobId !== undefined) {
401
- const labelValue: string = input.JobId;
402
- if (labelValue.length <= 0) {
403
- throw new Error("Empty value provided for input HTTP label: JobId.");
404
- }
405
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
406
- } else {
407
- throw new Error("No value provided for input HTTP label: JobId.");
408
- }
409
- let body: any;
410
- return new __HttpRequest({
411
- protocol,
412
- hostname,
413
- port,
414
- method: "GET",
415
- headers,
416
- path: resolvedPath,
417
- body,
418
- });
419
- };
420
-
421
- export const serializeAws_restJson1GetRevisionCommand = async (
422
- input: GetRevisionCommandInput,
423
- context: __SerdeContext
424
- ): Promise<__HttpRequest> => {
425
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
426
- const headers: any = {};
427
- let resolvedPath =
428
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
429
- "/v1/data-sets/{DataSetId}/revisions/{RevisionId}";
430
- if (input.DataSetId !== undefined) {
431
- const labelValue: string = input.DataSetId;
432
- if (labelValue.length <= 0) {
433
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
434
- }
435
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
436
- } else {
437
- throw new Error("No value provided for input HTTP label: DataSetId.");
438
- }
439
- if (input.RevisionId !== undefined) {
440
- const labelValue: string = input.RevisionId;
441
- if (labelValue.length <= 0) {
442
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
443
- }
444
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
445
- } else {
446
- throw new Error("No value provided for input HTTP label: RevisionId.");
447
- }
448
- let body: any;
449
- return new __HttpRequest({
450
- protocol,
451
- hostname,
452
- port,
453
- method: "GET",
454
- headers,
455
- path: resolvedPath,
456
- body,
457
- });
458
- };
459
-
460
- export const serializeAws_restJson1ListDataSetRevisionsCommand = async (
461
- input: ListDataSetRevisionsCommandInput,
462
- context: __SerdeContext
463
- ): Promise<__HttpRequest> => {
464
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
465
- const headers: any = {};
466
- let resolvedPath =
467
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/data-sets/{DataSetId}/revisions";
468
- if (input.DataSetId !== undefined) {
469
- const labelValue: string = input.DataSetId;
470
- if (labelValue.length <= 0) {
471
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
472
- }
473
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
474
- } else {
475
- throw new Error("No value provided for input HTTP label: DataSetId.");
476
- }
477
- const query: any = {
478
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
479
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
480
- };
481
- let body: any;
482
- return new __HttpRequest({
483
- protocol,
484
- hostname,
485
- port,
486
- method: "GET",
487
- headers,
488
- path: resolvedPath,
489
- query,
490
- body,
491
- });
492
- };
493
-
494
- export const serializeAws_restJson1ListDataSetsCommand = async (
495
- input: ListDataSetsCommandInput,
496
- context: __SerdeContext
497
- ): Promise<__HttpRequest> => {
498
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
499
- const headers: any = {};
500
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/data-sets";
501
- const query: any = {
502
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
503
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
504
- ...(input.Origin !== undefined && { origin: input.Origin }),
505
- };
506
- let body: any;
507
- return new __HttpRequest({
508
- protocol,
509
- hostname,
510
- port,
511
- method: "GET",
512
- headers,
513
- path: resolvedPath,
514
- query,
515
- body,
516
- });
517
- };
518
-
519
- export const serializeAws_restJson1ListJobsCommand = async (
520
- input: ListJobsCommandInput,
521
- context: __SerdeContext
522
- ): Promise<__HttpRequest> => {
523
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
524
- const headers: any = {};
525
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/jobs";
526
- const query: any = {
527
- ...(input.DataSetId !== undefined && { dataSetId: input.DataSetId }),
528
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
529
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
530
- ...(input.RevisionId !== undefined && { revisionId: input.RevisionId }),
531
- };
532
- let body: any;
533
- return new __HttpRequest({
534
- protocol,
535
- hostname,
536
- port,
537
- method: "GET",
538
- headers,
539
- path: resolvedPath,
540
- query,
541
- body,
542
- });
543
- };
544
-
545
- export const serializeAws_restJson1ListRevisionAssetsCommand = async (
546
- input: ListRevisionAssetsCommandInput,
547
- context: __SerdeContext
548
- ): Promise<__HttpRequest> => {
549
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
550
- const headers: any = {};
551
- let resolvedPath =
552
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
553
- "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets";
554
- if (input.DataSetId !== undefined) {
555
- const labelValue: string = input.DataSetId;
556
- if (labelValue.length <= 0) {
557
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
558
- }
559
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
560
- } else {
561
- throw new Error("No value provided for input HTTP label: DataSetId.");
562
- }
563
- if (input.RevisionId !== undefined) {
564
- const labelValue: string = input.RevisionId;
565
- if (labelValue.length <= 0) {
566
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
567
- }
568
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
569
- } else {
570
- throw new Error("No value provided for input HTTP label: RevisionId.");
571
- }
572
- const query: any = {
573
- ...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
574
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
575
- };
576
- let body: any;
577
- return new __HttpRequest({
578
- protocol,
579
- hostname,
580
- port,
581
- method: "GET",
582
- headers,
583
- path: resolvedPath,
584
- query,
585
- body,
586
- });
587
- };
588
-
589
- export const serializeAws_restJson1ListTagsForResourceCommand = async (
590
- input: ListTagsForResourceCommandInput,
591
- context: __SerdeContext
592
- ): Promise<__HttpRequest> => {
593
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
594
- const headers: any = {};
595
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
596
- if (input.ResourceArn !== undefined) {
597
- const labelValue: string = input.ResourceArn;
598
- if (labelValue.length <= 0) {
599
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
600
- }
601
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
602
- } else {
603
- throw new Error("No value provided for input HTTP label: ResourceArn.");
604
- }
605
- let body: any;
606
- return new __HttpRequest({
607
- protocol,
608
- hostname,
609
- port,
610
- method: "GET",
611
- headers,
612
- path: resolvedPath,
613
- body,
614
- });
615
- };
616
-
617
- export const serializeAws_restJson1StartJobCommand = async (
618
- input: StartJobCommandInput,
619
- context: __SerdeContext
620
- ): Promise<__HttpRequest> => {
621
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
622
- const headers: any = {};
623
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/jobs/{JobId}";
624
- if (input.JobId !== undefined) {
625
- const labelValue: string = input.JobId;
626
- if (labelValue.length <= 0) {
627
- throw new Error("Empty value provided for input HTTP label: JobId.");
628
- }
629
- resolvedPath = resolvedPath.replace("{JobId}", __extendedEncodeURIComponent(labelValue));
630
- } else {
631
- throw new Error("No value provided for input HTTP label: JobId.");
632
- }
633
- let body: any;
634
- return new __HttpRequest({
635
- protocol,
636
- hostname,
637
- port,
638
- method: "PATCH",
639
- headers,
640
- path: resolvedPath,
641
- body,
642
- });
643
- };
644
-
645
- export const serializeAws_restJson1TagResourceCommand = async (
646
- input: TagResourceCommandInput,
647
- context: __SerdeContext
648
- ): Promise<__HttpRequest> => {
649
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
650
- const headers: any = {
651
- "content-type": "application/json",
652
- };
653
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
654
- if (input.ResourceArn !== undefined) {
655
- const labelValue: string = input.ResourceArn;
656
- if (labelValue.length <= 0) {
657
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
658
- }
659
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
660
- } else {
661
- throw new Error("No value provided for input HTTP label: ResourceArn.");
662
- }
663
- let body: any;
664
- body = JSON.stringify({
665
- ...(input.Tags !== undefined &&
666
- input.Tags !== null && { tags: serializeAws_restJson1MapOf__string(input.Tags, context) }),
667
- });
668
- return new __HttpRequest({
669
- protocol,
670
- hostname,
671
- port,
672
- method: "POST",
673
- headers,
674
- path: resolvedPath,
675
- body,
676
- });
677
- };
678
-
679
- export const serializeAws_restJson1UntagResourceCommand = async (
680
- input: UntagResourceCommandInput,
681
- context: __SerdeContext
682
- ): Promise<__HttpRequest> => {
683
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
684
- const headers: any = {};
685
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
686
- if (input.ResourceArn !== undefined) {
687
- const labelValue: string = input.ResourceArn;
688
- if (labelValue.length <= 0) {
689
- throw new Error("Empty value provided for input HTTP label: ResourceArn.");
690
- }
691
- resolvedPath = resolvedPath.replace("{ResourceArn}", __extendedEncodeURIComponent(labelValue));
692
- } else {
693
- throw new Error("No value provided for input HTTP label: ResourceArn.");
694
- }
695
- const query: any = {
696
- ...(input.TagKeys !== undefined && { tagKeys: (input.TagKeys || []).map((_entry) => _entry as any) }),
697
- };
698
- let body: any;
699
- return new __HttpRequest({
700
- protocol,
701
- hostname,
702
- port,
703
- method: "DELETE",
704
- headers,
705
- path: resolvedPath,
706
- query,
707
- body,
708
- });
709
- };
710
-
711
- export const serializeAws_restJson1UpdateAssetCommand = async (
712
- input: UpdateAssetCommandInput,
713
- context: __SerdeContext
714
- ): Promise<__HttpRequest> => {
715
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
716
- const headers: any = {
717
- "content-type": "application/json",
718
- };
719
- let resolvedPath =
720
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
721
- "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}";
722
- if (input.AssetId !== undefined) {
723
- const labelValue: string = input.AssetId;
724
- if (labelValue.length <= 0) {
725
- throw new Error("Empty value provided for input HTTP label: AssetId.");
726
- }
727
- resolvedPath = resolvedPath.replace("{AssetId}", __extendedEncodeURIComponent(labelValue));
728
- } else {
729
- throw new Error("No value provided for input HTTP label: AssetId.");
730
- }
731
- if (input.DataSetId !== undefined) {
732
- const labelValue: string = input.DataSetId;
733
- if (labelValue.length <= 0) {
734
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
735
- }
736
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
737
- } else {
738
- throw new Error("No value provided for input HTTP label: DataSetId.");
739
- }
740
- if (input.RevisionId !== undefined) {
741
- const labelValue: string = input.RevisionId;
742
- if (labelValue.length <= 0) {
743
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
744
- }
745
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
746
- } else {
747
- throw new Error("No value provided for input HTTP label: RevisionId.");
748
- }
749
- let body: any;
750
- body = JSON.stringify({
751
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
752
- });
753
- return new __HttpRequest({
754
- protocol,
755
- hostname,
756
- port,
757
- method: "PATCH",
758
- headers,
759
- path: resolvedPath,
760
- body,
761
- });
762
- };
763
-
764
- export const serializeAws_restJson1UpdateDataSetCommand = async (
765
- input: UpdateDataSetCommandInput,
766
- context: __SerdeContext
767
- ): Promise<__HttpRequest> => {
768
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
769
- const headers: any = {
770
- "content-type": "application/json",
771
- };
772
- let resolvedPath =
773
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/data-sets/{DataSetId}";
774
- if (input.DataSetId !== undefined) {
775
- const labelValue: string = input.DataSetId;
776
- if (labelValue.length <= 0) {
777
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
778
- }
779
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
780
- } else {
781
- throw new Error("No value provided for input HTTP label: DataSetId.");
782
- }
783
- let body: any;
784
- body = JSON.stringify({
785
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
786
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
787
- });
788
- return new __HttpRequest({
789
- protocol,
790
- hostname,
791
- port,
792
- method: "PATCH",
793
- headers,
794
- path: resolvedPath,
795
- body,
796
- });
797
- };
798
-
799
- export const serializeAws_restJson1UpdateRevisionCommand = async (
800
- input: UpdateRevisionCommandInput,
801
- context: __SerdeContext
802
- ): Promise<__HttpRequest> => {
803
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
804
- const headers: any = {
805
- "content-type": "application/json",
806
- };
807
- let resolvedPath =
808
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
809
- "/v1/data-sets/{DataSetId}/revisions/{RevisionId}";
810
- if (input.DataSetId !== undefined) {
811
- const labelValue: string = input.DataSetId;
812
- if (labelValue.length <= 0) {
813
- throw new Error("Empty value provided for input HTTP label: DataSetId.");
814
- }
815
- resolvedPath = resolvedPath.replace("{DataSetId}", __extendedEncodeURIComponent(labelValue));
816
- } else {
817
- throw new Error("No value provided for input HTTP label: DataSetId.");
818
- }
819
- if (input.RevisionId !== undefined) {
820
- const labelValue: string = input.RevisionId;
821
- if (labelValue.length <= 0) {
822
- throw new Error("Empty value provided for input HTTP label: RevisionId.");
823
- }
824
- resolvedPath = resolvedPath.replace("{RevisionId}", __extendedEncodeURIComponent(labelValue));
825
- } else {
826
- throw new Error("No value provided for input HTTP label: RevisionId.");
827
- }
828
- let body: any;
829
- body = JSON.stringify({
830
- ...(input.Comment !== undefined && input.Comment !== null && { Comment: input.Comment }),
831
- ...(input.Finalized !== undefined && input.Finalized !== null && { Finalized: input.Finalized }),
832
- });
833
- return new __HttpRequest({
834
- protocol,
835
- hostname,
836
- port,
837
- method: "PATCH",
838
- headers,
839
- path: resolvedPath,
840
- body,
841
- });
842
- };
843
-
844
- export const deserializeAws_restJson1CancelJobCommand = async (
845
- output: __HttpResponse,
846
- context: __SerdeContext
847
- ): Promise<CancelJobCommandOutput> => {
848
- if (output.statusCode !== 204 && output.statusCode >= 300) {
849
- return deserializeAws_restJson1CancelJobCommandError(output, context);
850
- }
851
- const contents: CancelJobCommandOutput = {
852
- $metadata: deserializeMetadata(output),
853
- };
854
- await collectBody(output.body, context);
855
- return Promise.resolve(contents);
856
- };
857
-
858
- const deserializeAws_restJson1CancelJobCommandError = async (
859
- output: __HttpResponse,
860
- context: __SerdeContext
861
- ): Promise<CancelJobCommandOutput> => {
862
- const parsedOutput: any = {
863
- ...output,
864
- body: await parseBody(output.body, context),
865
- };
866
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
867
- let errorCode: string = "UnknownError";
868
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
869
- switch (errorCode) {
870
- case "ConflictException":
871
- case "com.amazonaws.dataexchange#ConflictException":
872
- response = {
873
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
874
- name: errorCode,
875
- $metadata: deserializeMetadata(output),
876
- };
877
- break;
878
- case "InternalServerException":
879
- case "com.amazonaws.dataexchange#InternalServerException":
880
- response = {
881
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
882
- name: errorCode,
883
- $metadata: deserializeMetadata(output),
884
- };
885
- break;
886
- case "ResourceNotFoundException":
887
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
888
- response = {
889
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
890
- name: errorCode,
891
- $metadata: deserializeMetadata(output),
892
- };
893
- break;
894
- case "ThrottlingException":
895
- case "com.amazonaws.dataexchange#ThrottlingException":
896
- response = {
897
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
898
- name: errorCode,
899
- $metadata: deserializeMetadata(output),
900
- };
901
- break;
902
- case "ValidationException":
903
- case "com.amazonaws.dataexchange#ValidationException":
904
- response = {
905
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
906
- name: errorCode,
907
- $metadata: deserializeMetadata(output),
908
- };
909
- break;
910
- default:
911
- const parsedBody = parsedOutput.body;
912
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
913
- response = {
914
- ...parsedBody,
915
- name: `${errorCode}`,
916
- message: parsedBody.message || parsedBody.Message || errorCode,
917
- $fault: "client",
918
- $metadata: deserializeMetadata(output),
919
- } as any;
920
- }
921
- const message = response.message || response.Message || errorCode;
922
- response.message = message;
923
- delete response.Message;
924
- return Promise.reject(Object.assign(new Error(message), response));
925
- };
926
-
927
- export const deserializeAws_restJson1CreateDataSetCommand = async (
928
- output: __HttpResponse,
929
- context: __SerdeContext
930
- ): Promise<CreateDataSetCommandOutput> => {
931
- if (output.statusCode !== 201 && output.statusCode >= 300) {
932
- return deserializeAws_restJson1CreateDataSetCommandError(output, context);
933
- }
934
- const contents: CreateDataSetCommandOutput = {
935
- $metadata: deserializeMetadata(output),
936
- Arn: undefined,
937
- AssetType: undefined,
938
- CreatedAt: undefined,
939
- Description: undefined,
940
- Id: undefined,
941
- Name: undefined,
942
- Origin: undefined,
943
- OriginDetails: undefined,
944
- SourceId: undefined,
945
- Tags: undefined,
946
- UpdatedAt: undefined,
947
- };
948
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
949
- if (data.Arn !== undefined && data.Arn !== null) {
950
- contents.Arn = __expectString(data.Arn);
951
- }
952
- if (data.AssetType !== undefined && data.AssetType !== null) {
953
- contents.AssetType = __expectString(data.AssetType);
954
- }
955
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
956
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
957
- }
958
- if (data.Description !== undefined && data.Description !== null) {
959
- contents.Description = __expectString(data.Description);
960
- }
961
- if (data.Id !== undefined && data.Id !== null) {
962
- contents.Id = __expectString(data.Id);
963
- }
964
- if (data.Name !== undefined && data.Name !== null) {
965
- contents.Name = __expectString(data.Name);
966
- }
967
- if (data.Origin !== undefined && data.Origin !== null) {
968
- contents.Origin = __expectString(data.Origin);
969
- }
970
- if (data.OriginDetails !== undefined && data.OriginDetails !== null) {
971
- contents.OriginDetails = deserializeAws_restJson1OriginDetails(data.OriginDetails, context);
972
- }
973
- if (data.SourceId !== undefined && data.SourceId !== null) {
974
- contents.SourceId = __expectString(data.SourceId);
975
- }
976
- if (data.Tags !== undefined && data.Tags !== null) {
977
- contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
978
- }
979
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
980
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
981
- }
982
- return Promise.resolve(contents);
983
- };
984
-
985
- const deserializeAws_restJson1CreateDataSetCommandError = async (
986
- output: __HttpResponse,
987
- context: __SerdeContext
988
- ): Promise<CreateDataSetCommandOutput> => {
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: string = "UnknownError";
995
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
996
- switch (errorCode) {
997
- case "AccessDeniedException":
998
- case "com.amazonaws.dataexchange#AccessDeniedException":
999
- response = {
1000
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1001
- name: errorCode,
1002
- $metadata: deserializeMetadata(output),
1003
- };
1004
- break;
1005
- case "InternalServerException":
1006
- case "com.amazonaws.dataexchange#InternalServerException":
1007
- response = {
1008
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1009
- name: errorCode,
1010
- $metadata: deserializeMetadata(output),
1011
- };
1012
- break;
1013
- case "ServiceLimitExceededException":
1014
- case "com.amazonaws.dataexchange#ServiceLimitExceededException":
1015
- response = {
1016
- ...(await deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)),
1017
- name: errorCode,
1018
- $metadata: deserializeMetadata(output),
1019
- };
1020
- break;
1021
- case "ThrottlingException":
1022
- case "com.amazonaws.dataexchange#ThrottlingException":
1023
- response = {
1024
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1025
- name: errorCode,
1026
- $metadata: deserializeMetadata(output),
1027
- };
1028
- break;
1029
- case "ValidationException":
1030
- case "com.amazonaws.dataexchange#ValidationException":
1031
- response = {
1032
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1033
- name: errorCode,
1034
- $metadata: deserializeMetadata(output),
1035
- };
1036
- break;
1037
- default:
1038
- const parsedBody = parsedOutput.body;
1039
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1040
- response = {
1041
- ...parsedBody,
1042
- name: `${errorCode}`,
1043
- message: parsedBody.message || parsedBody.Message || errorCode,
1044
- $fault: "client",
1045
- $metadata: deserializeMetadata(output),
1046
- } as any;
1047
- }
1048
- const message = response.message || response.Message || errorCode;
1049
- response.message = message;
1050
- delete response.Message;
1051
- return Promise.reject(Object.assign(new Error(message), response));
1052
- };
1053
-
1054
- export const deserializeAws_restJson1CreateJobCommand = async (
1055
- output: __HttpResponse,
1056
- context: __SerdeContext
1057
- ): Promise<CreateJobCommandOutput> => {
1058
- if (output.statusCode !== 201 && output.statusCode >= 300) {
1059
- return deserializeAws_restJson1CreateJobCommandError(output, context);
1060
- }
1061
- const contents: CreateJobCommandOutput = {
1062
- $metadata: deserializeMetadata(output),
1063
- Arn: undefined,
1064
- CreatedAt: undefined,
1065
- Details: undefined,
1066
- Errors: undefined,
1067
- Id: undefined,
1068
- State: undefined,
1069
- Type: undefined,
1070
- UpdatedAt: undefined,
1071
- };
1072
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1073
- if (data.Arn !== undefined && data.Arn !== null) {
1074
- contents.Arn = __expectString(data.Arn);
1075
- }
1076
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1077
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1078
- }
1079
- if (data.Details !== undefined && data.Details !== null) {
1080
- contents.Details = deserializeAws_restJson1ResponseDetails(data.Details, context);
1081
- }
1082
- if (data.Errors !== undefined && data.Errors !== null) {
1083
- contents.Errors = deserializeAws_restJson1ListOfJobError(data.Errors, context);
1084
- }
1085
- if (data.Id !== undefined && data.Id !== null) {
1086
- contents.Id = __expectString(data.Id);
1087
- }
1088
- if (data.State !== undefined && data.State !== null) {
1089
- contents.State = __expectString(data.State);
1090
- }
1091
- if (data.Type !== undefined && data.Type !== null) {
1092
- contents.Type = __expectString(data.Type);
1093
- }
1094
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1095
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1096
- }
1097
- return Promise.resolve(contents);
1098
- };
1099
-
1100
- const deserializeAws_restJson1CreateJobCommandError = async (
1101
- output: __HttpResponse,
1102
- context: __SerdeContext
1103
- ): Promise<CreateJobCommandOutput> => {
1104
- const parsedOutput: any = {
1105
- ...output,
1106
- body: await parseBody(output.body, context),
1107
- };
1108
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1109
- let errorCode: string = "UnknownError";
1110
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1111
- switch (errorCode) {
1112
- case "AccessDeniedException":
1113
- case "com.amazonaws.dataexchange#AccessDeniedException":
1114
- response = {
1115
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1116
- name: errorCode,
1117
- $metadata: deserializeMetadata(output),
1118
- };
1119
- break;
1120
- case "InternalServerException":
1121
- case "com.amazonaws.dataexchange#InternalServerException":
1122
- response = {
1123
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1124
- name: errorCode,
1125
- $metadata: deserializeMetadata(output),
1126
- };
1127
- break;
1128
- case "ResourceNotFoundException":
1129
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1130
- response = {
1131
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1132
- name: errorCode,
1133
- $metadata: deserializeMetadata(output),
1134
- };
1135
- break;
1136
- case "ThrottlingException":
1137
- case "com.amazonaws.dataexchange#ThrottlingException":
1138
- response = {
1139
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1140
- name: errorCode,
1141
- $metadata: deserializeMetadata(output),
1142
- };
1143
- break;
1144
- case "ValidationException":
1145
- case "com.amazonaws.dataexchange#ValidationException":
1146
- response = {
1147
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1148
- name: errorCode,
1149
- $metadata: deserializeMetadata(output),
1150
- };
1151
- break;
1152
- default:
1153
- const parsedBody = parsedOutput.body;
1154
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1155
- response = {
1156
- ...parsedBody,
1157
- name: `${errorCode}`,
1158
- message: parsedBody.message || parsedBody.Message || errorCode,
1159
- $fault: "client",
1160
- $metadata: deserializeMetadata(output),
1161
- } as any;
1162
- }
1163
- const message = response.message || response.Message || errorCode;
1164
- response.message = message;
1165
- delete response.Message;
1166
- return Promise.reject(Object.assign(new Error(message), response));
1167
- };
1168
-
1169
- export const deserializeAws_restJson1CreateRevisionCommand = async (
1170
- output: __HttpResponse,
1171
- context: __SerdeContext
1172
- ): Promise<CreateRevisionCommandOutput> => {
1173
- if (output.statusCode !== 201 && output.statusCode >= 300) {
1174
- return deserializeAws_restJson1CreateRevisionCommandError(output, context);
1175
- }
1176
- const contents: CreateRevisionCommandOutput = {
1177
- $metadata: deserializeMetadata(output),
1178
- Arn: undefined,
1179
- Comment: undefined,
1180
- CreatedAt: undefined,
1181
- DataSetId: undefined,
1182
- Finalized: undefined,
1183
- Id: undefined,
1184
- SourceId: undefined,
1185
- Tags: undefined,
1186
- UpdatedAt: undefined,
1187
- };
1188
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1189
- if (data.Arn !== undefined && data.Arn !== null) {
1190
- contents.Arn = __expectString(data.Arn);
1191
- }
1192
- if (data.Comment !== undefined && data.Comment !== null) {
1193
- contents.Comment = __expectString(data.Comment);
1194
- }
1195
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1196
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1197
- }
1198
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
1199
- contents.DataSetId = __expectString(data.DataSetId);
1200
- }
1201
- if (data.Finalized !== undefined && data.Finalized !== null) {
1202
- contents.Finalized = __expectBoolean(data.Finalized);
1203
- }
1204
- if (data.Id !== undefined && data.Id !== null) {
1205
- contents.Id = __expectString(data.Id);
1206
- }
1207
- if (data.SourceId !== undefined && data.SourceId !== null) {
1208
- contents.SourceId = __expectString(data.SourceId);
1209
- }
1210
- if (data.Tags !== undefined && data.Tags !== null) {
1211
- contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
1212
- }
1213
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1214
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1215
- }
1216
- return Promise.resolve(contents);
1217
- };
1218
-
1219
- const deserializeAws_restJson1CreateRevisionCommandError = async (
1220
- output: __HttpResponse,
1221
- context: __SerdeContext
1222
- ): Promise<CreateRevisionCommandOutput> => {
1223
- const parsedOutput: any = {
1224
- ...output,
1225
- body: await parseBody(output.body, context),
1226
- };
1227
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1228
- let errorCode: string = "UnknownError";
1229
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1230
- switch (errorCode) {
1231
- case "AccessDeniedException":
1232
- case "com.amazonaws.dataexchange#AccessDeniedException":
1233
- response = {
1234
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1235
- name: errorCode,
1236
- $metadata: deserializeMetadata(output),
1237
- };
1238
- break;
1239
- case "InternalServerException":
1240
- case "com.amazonaws.dataexchange#InternalServerException":
1241
- response = {
1242
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1243
- name: errorCode,
1244
- $metadata: deserializeMetadata(output),
1245
- };
1246
- break;
1247
- case "ResourceNotFoundException":
1248
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1249
- response = {
1250
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1251
- name: errorCode,
1252
- $metadata: deserializeMetadata(output),
1253
- };
1254
- break;
1255
- case "ThrottlingException":
1256
- case "com.amazonaws.dataexchange#ThrottlingException":
1257
- response = {
1258
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1259
- name: errorCode,
1260
- $metadata: deserializeMetadata(output),
1261
- };
1262
- break;
1263
- case "ValidationException":
1264
- case "com.amazonaws.dataexchange#ValidationException":
1265
- response = {
1266
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1267
- name: errorCode,
1268
- $metadata: deserializeMetadata(output),
1269
- };
1270
- break;
1271
- default:
1272
- const parsedBody = parsedOutput.body;
1273
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1274
- response = {
1275
- ...parsedBody,
1276
- name: `${errorCode}`,
1277
- message: parsedBody.message || parsedBody.Message || errorCode,
1278
- $fault: "client",
1279
- $metadata: deserializeMetadata(output),
1280
- } as any;
1281
- }
1282
- const message = response.message || response.Message || errorCode;
1283
- response.message = message;
1284
- delete response.Message;
1285
- return Promise.reject(Object.assign(new Error(message), response));
1286
- };
1287
-
1288
- export const deserializeAws_restJson1DeleteAssetCommand = async (
1289
- output: __HttpResponse,
1290
- context: __SerdeContext
1291
- ): Promise<DeleteAssetCommandOutput> => {
1292
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1293
- return deserializeAws_restJson1DeleteAssetCommandError(output, context);
1294
- }
1295
- const contents: DeleteAssetCommandOutput = {
1296
- $metadata: deserializeMetadata(output),
1297
- };
1298
- await collectBody(output.body, context);
1299
- return Promise.resolve(contents);
1300
- };
1301
-
1302
- const deserializeAws_restJson1DeleteAssetCommandError = async (
1303
- output: __HttpResponse,
1304
- context: __SerdeContext
1305
- ): Promise<DeleteAssetCommandOutput> => {
1306
- const parsedOutput: any = {
1307
- ...output,
1308
- body: await parseBody(output.body, context),
1309
- };
1310
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1311
- let errorCode: string = "UnknownError";
1312
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1313
- switch (errorCode) {
1314
- case "AccessDeniedException":
1315
- case "com.amazonaws.dataexchange#AccessDeniedException":
1316
- response = {
1317
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1318
- name: errorCode,
1319
- $metadata: deserializeMetadata(output),
1320
- };
1321
- break;
1322
- case "ConflictException":
1323
- case "com.amazonaws.dataexchange#ConflictException":
1324
- response = {
1325
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1326
- name: errorCode,
1327
- $metadata: deserializeMetadata(output),
1328
- };
1329
- break;
1330
- case "InternalServerException":
1331
- case "com.amazonaws.dataexchange#InternalServerException":
1332
- response = {
1333
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1334
- name: errorCode,
1335
- $metadata: deserializeMetadata(output),
1336
- };
1337
- break;
1338
- case "ResourceNotFoundException":
1339
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1340
- response = {
1341
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1342
- name: errorCode,
1343
- $metadata: deserializeMetadata(output),
1344
- };
1345
- break;
1346
- case "ThrottlingException":
1347
- case "com.amazonaws.dataexchange#ThrottlingException":
1348
- response = {
1349
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1350
- name: errorCode,
1351
- $metadata: deserializeMetadata(output),
1352
- };
1353
- break;
1354
- case "ValidationException":
1355
- case "com.amazonaws.dataexchange#ValidationException":
1356
- response = {
1357
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1358
- name: errorCode,
1359
- $metadata: deserializeMetadata(output),
1360
- };
1361
- break;
1362
- default:
1363
- const parsedBody = parsedOutput.body;
1364
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1365
- response = {
1366
- ...parsedBody,
1367
- name: `${errorCode}`,
1368
- message: parsedBody.message || parsedBody.Message || errorCode,
1369
- $fault: "client",
1370
- $metadata: deserializeMetadata(output),
1371
- } as any;
1372
- }
1373
- const message = response.message || response.Message || errorCode;
1374
- response.message = message;
1375
- delete response.Message;
1376
- return Promise.reject(Object.assign(new Error(message), response));
1377
- };
1378
-
1379
- export const deserializeAws_restJson1DeleteDataSetCommand = async (
1380
- output: __HttpResponse,
1381
- context: __SerdeContext
1382
- ): Promise<DeleteDataSetCommandOutput> => {
1383
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1384
- return deserializeAws_restJson1DeleteDataSetCommandError(output, context);
1385
- }
1386
- const contents: DeleteDataSetCommandOutput = {
1387
- $metadata: deserializeMetadata(output),
1388
- };
1389
- await collectBody(output.body, context);
1390
- return Promise.resolve(contents);
1391
- };
1392
-
1393
- const deserializeAws_restJson1DeleteDataSetCommandError = async (
1394
- output: __HttpResponse,
1395
- context: __SerdeContext
1396
- ): Promise<DeleteDataSetCommandOutput> => {
1397
- const parsedOutput: any = {
1398
- ...output,
1399
- body: await parseBody(output.body, context),
1400
- };
1401
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1402
- let errorCode: string = "UnknownError";
1403
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1404
- switch (errorCode) {
1405
- case "AccessDeniedException":
1406
- case "com.amazonaws.dataexchange#AccessDeniedException":
1407
- response = {
1408
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1409
- name: errorCode,
1410
- $metadata: deserializeMetadata(output),
1411
- };
1412
- break;
1413
- case "ConflictException":
1414
- case "com.amazonaws.dataexchange#ConflictException":
1415
- response = {
1416
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1417
- name: errorCode,
1418
- $metadata: deserializeMetadata(output),
1419
- };
1420
- break;
1421
- case "InternalServerException":
1422
- case "com.amazonaws.dataexchange#InternalServerException":
1423
- response = {
1424
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1425
- name: errorCode,
1426
- $metadata: deserializeMetadata(output),
1427
- };
1428
- break;
1429
- case "ResourceNotFoundException":
1430
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1431
- response = {
1432
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1433
- name: errorCode,
1434
- $metadata: deserializeMetadata(output),
1435
- };
1436
- break;
1437
- case "ThrottlingException":
1438
- case "com.amazonaws.dataexchange#ThrottlingException":
1439
- response = {
1440
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1441
- name: errorCode,
1442
- $metadata: deserializeMetadata(output),
1443
- };
1444
- break;
1445
- case "ValidationException":
1446
- case "com.amazonaws.dataexchange#ValidationException":
1447
- response = {
1448
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1449
- name: errorCode,
1450
- $metadata: deserializeMetadata(output),
1451
- };
1452
- break;
1453
- default:
1454
- const parsedBody = parsedOutput.body;
1455
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1456
- response = {
1457
- ...parsedBody,
1458
- name: `${errorCode}`,
1459
- message: parsedBody.message || parsedBody.Message || errorCode,
1460
- $fault: "client",
1461
- $metadata: deserializeMetadata(output),
1462
- } as any;
1463
- }
1464
- const message = response.message || response.Message || errorCode;
1465
- response.message = message;
1466
- delete response.Message;
1467
- return Promise.reject(Object.assign(new Error(message), response));
1468
- };
1469
-
1470
- export const deserializeAws_restJson1DeleteRevisionCommand = async (
1471
- output: __HttpResponse,
1472
- context: __SerdeContext
1473
- ): Promise<DeleteRevisionCommandOutput> => {
1474
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1475
- return deserializeAws_restJson1DeleteRevisionCommandError(output, context);
1476
- }
1477
- const contents: DeleteRevisionCommandOutput = {
1478
- $metadata: deserializeMetadata(output),
1479
- };
1480
- await collectBody(output.body, context);
1481
- return Promise.resolve(contents);
1482
- };
1483
-
1484
- const deserializeAws_restJson1DeleteRevisionCommandError = async (
1485
- output: __HttpResponse,
1486
- context: __SerdeContext
1487
- ): Promise<DeleteRevisionCommandOutput> => {
1488
- const parsedOutput: any = {
1489
- ...output,
1490
- body: await parseBody(output.body, context),
1491
- };
1492
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1493
- let errorCode: string = "UnknownError";
1494
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1495
- switch (errorCode) {
1496
- case "AccessDeniedException":
1497
- case "com.amazonaws.dataexchange#AccessDeniedException":
1498
- response = {
1499
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1500
- name: errorCode,
1501
- $metadata: deserializeMetadata(output),
1502
- };
1503
- break;
1504
- case "ConflictException":
1505
- case "com.amazonaws.dataexchange#ConflictException":
1506
- response = {
1507
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1508
- name: errorCode,
1509
- $metadata: deserializeMetadata(output),
1510
- };
1511
- break;
1512
- case "InternalServerException":
1513
- case "com.amazonaws.dataexchange#InternalServerException":
1514
- response = {
1515
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1516
- name: errorCode,
1517
- $metadata: deserializeMetadata(output),
1518
- };
1519
- break;
1520
- case "ResourceNotFoundException":
1521
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1522
- response = {
1523
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1524
- name: errorCode,
1525
- $metadata: deserializeMetadata(output),
1526
- };
1527
- break;
1528
- case "ThrottlingException":
1529
- case "com.amazonaws.dataexchange#ThrottlingException":
1530
- response = {
1531
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1532
- name: errorCode,
1533
- $metadata: deserializeMetadata(output),
1534
- };
1535
- break;
1536
- case "ValidationException":
1537
- case "com.amazonaws.dataexchange#ValidationException":
1538
- response = {
1539
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1540
- name: errorCode,
1541
- $metadata: deserializeMetadata(output),
1542
- };
1543
- break;
1544
- default:
1545
- const parsedBody = parsedOutput.body;
1546
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1547
- response = {
1548
- ...parsedBody,
1549
- name: `${errorCode}`,
1550
- message: parsedBody.message || parsedBody.Message || errorCode,
1551
- $fault: "client",
1552
- $metadata: deserializeMetadata(output),
1553
- } as any;
1554
- }
1555
- const message = response.message || response.Message || errorCode;
1556
- response.message = message;
1557
- delete response.Message;
1558
- return Promise.reject(Object.assign(new Error(message), response));
1559
- };
1560
-
1561
- export const deserializeAws_restJson1GetAssetCommand = async (
1562
- output: __HttpResponse,
1563
- context: __SerdeContext
1564
- ): Promise<GetAssetCommandOutput> => {
1565
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1566
- return deserializeAws_restJson1GetAssetCommandError(output, context);
1567
- }
1568
- const contents: GetAssetCommandOutput = {
1569
- $metadata: deserializeMetadata(output),
1570
- Arn: undefined,
1571
- AssetDetails: undefined,
1572
- AssetType: undefined,
1573
- CreatedAt: undefined,
1574
- DataSetId: undefined,
1575
- Id: undefined,
1576
- Name: undefined,
1577
- RevisionId: undefined,
1578
- SourceId: undefined,
1579
- UpdatedAt: undefined,
1580
- };
1581
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1582
- if (data.Arn !== undefined && data.Arn !== null) {
1583
- contents.Arn = __expectString(data.Arn);
1584
- }
1585
- if (data.AssetDetails !== undefined && data.AssetDetails !== null) {
1586
- contents.AssetDetails = deserializeAws_restJson1AssetDetails(data.AssetDetails, context);
1587
- }
1588
- if (data.AssetType !== undefined && data.AssetType !== null) {
1589
- contents.AssetType = __expectString(data.AssetType);
1590
- }
1591
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1592
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1593
- }
1594
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
1595
- contents.DataSetId = __expectString(data.DataSetId);
1596
- }
1597
- if (data.Id !== undefined && data.Id !== null) {
1598
- contents.Id = __expectString(data.Id);
1599
- }
1600
- if (data.Name !== undefined && data.Name !== null) {
1601
- contents.Name = __expectString(data.Name);
1602
- }
1603
- if (data.RevisionId !== undefined && data.RevisionId !== null) {
1604
- contents.RevisionId = __expectString(data.RevisionId);
1605
- }
1606
- if (data.SourceId !== undefined && data.SourceId !== null) {
1607
- contents.SourceId = __expectString(data.SourceId);
1608
- }
1609
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1610
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1611
- }
1612
- return Promise.resolve(contents);
1613
- };
1614
-
1615
- const deserializeAws_restJson1GetAssetCommandError = async (
1616
- output: __HttpResponse,
1617
- context: __SerdeContext
1618
- ): Promise<GetAssetCommandOutput> => {
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: string = "UnknownError";
1625
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1626
- switch (errorCode) {
1627
- case "InternalServerException":
1628
- case "com.amazonaws.dataexchange#InternalServerException":
1629
- response = {
1630
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1631
- name: errorCode,
1632
- $metadata: deserializeMetadata(output),
1633
- };
1634
- break;
1635
- case "ResourceNotFoundException":
1636
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1637
- response = {
1638
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1639
- name: errorCode,
1640
- $metadata: deserializeMetadata(output),
1641
- };
1642
- break;
1643
- case "ThrottlingException":
1644
- case "com.amazonaws.dataexchange#ThrottlingException":
1645
- response = {
1646
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1647
- name: errorCode,
1648
- $metadata: deserializeMetadata(output),
1649
- };
1650
- break;
1651
- case "ValidationException":
1652
- case "com.amazonaws.dataexchange#ValidationException":
1653
- response = {
1654
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1655
- name: errorCode,
1656
- $metadata: deserializeMetadata(output),
1657
- };
1658
- break;
1659
- default:
1660
- const parsedBody = parsedOutput.body;
1661
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1662
- response = {
1663
- ...parsedBody,
1664
- name: `${errorCode}`,
1665
- message: parsedBody.message || parsedBody.Message || errorCode,
1666
- $fault: "client",
1667
- $metadata: deserializeMetadata(output),
1668
- } as any;
1669
- }
1670
- const message = response.message || response.Message || errorCode;
1671
- response.message = message;
1672
- delete response.Message;
1673
- return Promise.reject(Object.assign(new Error(message), response));
1674
- };
1675
-
1676
- export const deserializeAws_restJson1GetDataSetCommand = async (
1677
- output: __HttpResponse,
1678
- context: __SerdeContext
1679
- ): Promise<GetDataSetCommandOutput> => {
1680
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1681
- return deserializeAws_restJson1GetDataSetCommandError(output, context);
1682
- }
1683
- const contents: GetDataSetCommandOutput = {
1684
- $metadata: deserializeMetadata(output),
1685
- Arn: undefined,
1686
- AssetType: undefined,
1687
- CreatedAt: undefined,
1688
- Description: undefined,
1689
- Id: undefined,
1690
- Name: undefined,
1691
- Origin: undefined,
1692
- OriginDetails: undefined,
1693
- SourceId: undefined,
1694
- Tags: undefined,
1695
- UpdatedAt: undefined,
1696
- };
1697
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1698
- if (data.Arn !== undefined && data.Arn !== null) {
1699
- contents.Arn = __expectString(data.Arn);
1700
- }
1701
- if (data.AssetType !== undefined && data.AssetType !== null) {
1702
- contents.AssetType = __expectString(data.AssetType);
1703
- }
1704
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1705
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1706
- }
1707
- if (data.Description !== undefined && data.Description !== null) {
1708
- contents.Description = __expectString(data.Description);
1709
- }
1710
- if (data.Id !== undefined && data.Id !== null) {
1711
- contents.Id = __expectString(data.Id);
1712
- }
1713
- if (data.Name !== undefined && data.Name !== null) {
1714
- contents.Name = __expectString(data.Name);
1715
- }
1716
- if (data.Origin !== undefined && data.Origin !== null) {
1717
- contents.Origin = __expectString(data.Origin);
1718
- }
1719
- if (data.OriginDetails !== undefined && data.OriginDetails !== null) {
1720
- contents.OriginDetails = deserializeAws_restJson1OriginDetails(data.OriginDetails, context);
1721
- }
1722
- if (data.SourceId !== undefined && data.SourceId !== null) {
1723
- contents.SourceId = __expectString(data.SourceId);
1724
- }
1725
- if (data.Tags !== undefined && data.Tags !== null) {
1726
- contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
1727
- }
1728
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1729
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1730
- }
1731
- return Promise.resolve(contents);
1732
- };
1733
-
1734
- const deserializeAws_restJson1GetDataSetCommandError = async (
1735
- output: __HttpResponse,
1736
- context: __SerdeContext
1737
- ): Promise<GetDataSetCommandOutput> => {
1738
- const parsedOutput: any = {
1739
- ...output,
1740
- body: await parseBody(output.body, context),
1741
- };
1742
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1743
- let errorCode: string = "UnknownError";
1744
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1745
- switch (errorCode) {
1746
- case "InternalServerException":
1747
- case "com.amazonaws.dataexchange#InternalServerException":
1748
- response = {
1749
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1750
- name: errorCode,
1751
- $metadata: deserializeMetadata(output),
1752
- };
1753
- break;
1754
- case "ResourceNotFoundException":
1755
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1756
- response = {
1757
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1758
- name: errorCode,
1759
- $metadata: deserializeMetadata(output),
1760
- };
1761
- break;
1762
- case "ThrottlingException":
1763
- case "com.amazonaws.dataexchange#ThrottlingException":
1764
- response = {
1765
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1766
- name: errorCode,
1767
- $metadata: deserializeMetadata(output),
1768
- };
1769
- break;
1770
- case "ValidationException":
1771
- case "com.amazonaws.dataexchange#ValidationException":
1772
- response = {
1773
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1774
- name: errorCode,
1775
- $metadata: deserializeMetadata(output),
1776
- };
1777
- break;
1778
- default:
1779
- const parsedBody = parsedOutput.body;
1780
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1781
- response = {
1782
- ...parsedBody,
1783
- name: `${errorCode}`,
1784
- message: parsedBody.message || parsedBody.Message || errorCode,
1785
- $fault: "client",
1786
- $metadata: deserializeMetadata(output),
1787
- } as any;
1788
- }
1789
- const message = response.message || response.Message || errorCode;
1790
- response.message = message;
1791
- delete response.Message;
1792
- return Promise.reject(Object.assign(new Error(message), response));
1793
- };
1794
-
1795
- export const deserializeAws_restJson1GetJobCommand = async (
1796
- output: __HttpResponse,
1797
- context: __SerdeContext
1798
- ): Promise<GetJobCommandOutput> => {
1799
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1800
- return deserializeAws_restJson1GetJobCommandError(output, context);
1801
- }
1802
- const contents: GetJobCommandOutput = {
1803
- $metadata: deserializeMetadata(output),
1804
- Arn: undefined,
1805
- CreatedAt: undefined,
1806
- Details: undefined,
1807
- Errors: undefined,
1808
- Id: undefined,
1809
- State: undefined,
1810
- Type: undefined,
1811
- UpdatedAt: undefined,
1812
- };
1813
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1814
- if (data.Arn !== undefined && data.Arn !== null) {
1815
- contents.Arn = __expectString(data.Arn);
1816
- }
1817
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1818
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1819
- }
1820
- if (data.Details !== undefined && data.Details !== null) {
1821
- contents.Details = deserializeAws_restJson1ResponseDetails(data.Details, context);
1822
- }
1823
- if (data.Errors !== undefined && data.Errors !== null) {
1824
- contents.Errors = deserializeAws_restJson1ListOfJobError(data.Errors, context);
1825
- }
1826
- if (data.Id !== undefined && data.Id !== null) {
1827
- contents.Id = __expectString(data.Id);
1828
- }
1829
- if (data.State !== undefined && data.State !== null) {
1830
- contents.State = __expectString(data.State);
1831
- }
1832
- if (data.Type !== undefined && data.Type !== null) {
1833
- contents.Type = __expectString(data.Type);
1834
- }
1835
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1836
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1837
- }
1838
- return Promise.resolve(contents);
1839
- };
1840
-
1841
- const deserializeAws_restJson1GetJobCommandError = async (
1842
- output: __HttpResponse,
1843
- context: __SerdeContext
1844
- ): Promise<GetJobCommandOutput> => {
1845
- const parsedOutput: any = {
1846
- ...output,
1847
- body: await parseBody(output.body, context),
1848
- };
1849
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1850
- let errorCode: string = "UnknownError";
1851
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1852
- switch (errorCode) {
1853
- case "InternalServerException":
1854
- case "com.amazonaws.dataexchange#InternalServerException":
1855
- response = {
1856
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1857
- name: errorCode,
1858
- $metadata: deserializeMetadata(output),
1859
- };
1860
- break;
1861
- case "ResourceNotFoundException":
1862
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1863
- response = {
1864
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1865
- name: errorCode,
1866
- $metadata: deserializeMetadata(output),
1867
- };
1868
- break;
1869
- case "ThrottlingException":
1870
- case "com.amazonaws.dataexchange#ThrottlingException":
1871
- response = {
1872
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1873
- name: errorCode,
1874
- $metadata: deserializeMetadata(output),
1875
- };
1876
- break;
1877
- case "ValidationException":
1878
- case "com.amazonaws.dataexchange#ValidationException":
1879
- response = {
1880
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1881
- name: errorCode,
1882
- $metadata: deserializeMetadata(output),
1883
- };
1884
- break;
1885
- default:
1886
- const parsedBody = parsedOutput.body;
1887
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1888
- response = {
1889
- ...parsedBody,
1890
- name: `${errorCode}`,
1891
- message: parsedBody.message || parsedBody.Message || errorCode,
1892
- $fault: "client",
1893
- $metadata: deserializeMetadata(output),
1894
- } as any;
1895
- }
1896
- const message = response.message || response.Message || errorCode;
1897
- response.message = message;
1898
- delete response.Message;
1899
- return Promise.reject(Object.assign(new Error(message), response));
1900
- };
1901
-
1902
- export const deserializeAws_restJson1GetRevisionCommand = async (
1903
- output: __HttpResponse,
1904
- context: __SerdeContext
1905
- ): Promise<GetRevisionCommandOutput> => {
1906
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1907
- return deserializeAws_restJson1GetRevisionCommandError(output, context);
1908
- }
1909
- const contents: GetRevisionCommandOutput = {
1910
- $metadata: deserializeMetadata(output),
1911
- Arn: undefined,
1912
- Comment: undefined,
1913
- CreatedAt: undefined,
1914
- DataSetId: undefined,
1915
- Finalized: undefined,
1916
- Id: undefined,
1917
- SourceId: undefined,
1918
- Tags: undefined,
1919
- UpdatedAt: undefined,
1920
- };
1921
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1922
- if (data.Arn !== undefined && data.Arn !== null) {
1923
- contents.Arn = __expectString(data.Arn);
1924
- }
1925
- if (data.Comment !== undefined && data.Comment !== null) {
1926
- contents.Comment = __expectString(data.Comment);
1927
- }
1928
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
1929
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
1930
- }
1931
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
1932
- contents.DataSetId = __expectString(data.DataSetId);
1933
- }
1934
- if (data.Finalized !== undefined && data.Finalized !== null) {
1935
- contents.Finalized = __expectBoolean(data.Finalized);
1936
- }
1937
- if (data.Id !== undefined && data.Id !== null) {
1938
- contents.Id = __expectString(data.Id);
1939
- }
1940
- if (data.SourceId !== undefined && data.SourceId !== null) {
1941
- contents.SourceId = __expectString(data.SourceId);
1942
- }
1943
- if (data.Tags !== undefined && data.Tags !== null) {
1944
- contents.Tags = deserializeAws_restJson1MapOf__string(data.Tags, context);
1945
- }
1946
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
1947
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
1948
- }
1949
- return Promise.resolve(contents);
1950
- };
1951
-
1952
- const deserializeAws_restJson1GetRevisionCommandError = async (
1953
- output: __HttpResponse,
1954
- context: __SerdeContext
1955
- ): Promise<GetRevisionCommandOutput> => {
1956
- const parsedOutput: any = {
1957
- ...output,
1958
- body: await parseBody(output.body, context),
1959
- };
1960
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1961
- let errorCode: string = "UnknownError";
1962
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1963
- switch (errorCode) {
1964
- case "InternalServerException":
1965
- case "com.amazonaws.dataexchange#InternalServerException":
1966
- response = {
1967
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1968
- name: errorCode,
1969
- $metadata: deserializeMetadata(output),
1970
- };
1971
- break;
1972
- case "ResourceNotFoundException":
1973
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
1974
- response = {
1975
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1976
- name: errorCode,
1977
- $metadata: deserializeMetadata(output),
1978
- };
1979
- break;
1980
- case "ThrottlingException":
1981
- case "com.amazonaws.dataexchange#ThrottlingException":
1982
- response = {
1983
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
1984
- name: errorCode,
1985
- $metadata: deserializeMetadata(output),
1986
- };
1987
- break;
1988
- case "ValidationException":
1989
- case "com.amazonaws.dataexchange#ValidationException":
1990
- response = {
1991
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1992
- name: errorCode,
1993
- $metadata: deserializeMetadata(output),
1994
- };
1995
- break;
1996
- default:
1997
- const parsedBody = parsedOutput.body;
1998
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1999
- response = {
2000
- ...parsedBody,
2001
- name: `${errorCode}`,
2002
- message: parsedBody.message || parsedBody.Message || errorCode,
2003
- $fault: "client",
2004
- $metadata: deserializeMetadata(output),
2005
- } as any;
2006
- }
2007
- const message = response.message || response.Message || errorCode;
2008
- response.message = message;
2009
- delete response.Message;
2010
- return Promise.reject(Object.assign(new Error(message), response));
2011
- };
2012
-
2013
- export const deserializeAws_restJson1ListDataSetRevisionsCommand = async (
2014
- output: __HttpResponse,
2015
- context: __SerdeContext
2016
- ): Promise<ListDataSetRevisionsCommandOutput> => {
2017
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2018
- return deserializeAws_restJson1ListDataSetRevisionsCommandError(output, context);
2019
- }
2020
- const contents: ListDataSetRevisionsCommandOutput = {
2021
- $metadata: deserializeMetadata(output),
2022
- NextToken: undefined,
2023
- Revisions: undefined,
2024
- };
2025
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2026
- if (data.NextToken !== undefined && data.NextToken !== null) {
2027
- contents.NextToken = __expectString(data.NextToken);
2028
- }
2029
- if (data.Revisions !== undefined && data.Revisions !== null) {
2030
- contents.Revisions = deserializeAws_restJson1ListOfRevisionEntry(data.Revisions, context);
2031
- }
2032
- return Promise.resolve(contents);
2033
- };
2034
-
2035
- const deserializeAws_restJson1ListDataSetRevisionsCommandError = async (
2036
- output: __HttpResponse,
2037
- context: __SerdeContext
2038
- ): Promise<ListDataSetRevisionsCommandOutput> => {
2039
- const parsedOutput: any = {
2040
- ...output,
2041
- body: await parseBody(output.body, context),
2042
- };
2043
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2044
- let errorCode: string = "UnknownError";
2045
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2046
- switch (errorCode) {
2047
- case "InternalServerException":
2048
- case "com.amazonaws.dataexchange#InternalServerException":
2049
- response = {
2050
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2051
- name: errorCode,
2052
- $metadata: deserializeMetadata(output),
2053
- };
2054
- break;
2055
- case "ResourceNotFoundException":
2056
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2057
- response = {
2058
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2059
- name: errorCode,
2060
- $metadata: deserializeMetadata(output),
2061
- };
2062
- break;
2063
- case "ThrottlingException":
2064
- case "com.amazonaws.dataexchange#ThrottlingException":
2065
- response = {
2066
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2067
- name: errorCode,
2068
- $metadata: deserializeMetadata(output),
2069
- };
2070
- break;
2071
- case "ValidationException":
2072
- case "com.amazonaws.dataexchange#ValidationException":
2073
- response = {
2074
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2075
- name: errorCode,
2076
- $metadata: deserializeMetadata(output),
2077
- };
2078
- break;
2079
- default:
2080
- const parsedBody = parsedOutput.body;
2081
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2082
- response = {
2083
- ...parsedBody,
2084
- name: `${errorCode}`,
2085
- message: parsedBody.message || parsedBody.Message || errorCode,
2086
- $fault: "client",
2087
- $metadata: deserializeMetadata(output),
2088
- } as any;
2089
- }
2090
- const message = response.message || response.Message || errorCode;
2091
- response.message = message;
2092
- delete response.Message;
2093
- return Promise.reject(Object.assign(new Error(message), response));
2094
- };
2095
-
2096
- export const deserializeAws_restJson1ListDataSetsCommand = async (
2097
- output: __HttpResponse,
2098
- context: __SerdeContext
2099
- ): Promise<ListDataSetsCommandOutput> => {
2100
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2101
- return deserializeAws_restJson1ListDataSetsCommandError(output, context);
2102
- }
2103
- const contents: ListDataSetsCommandOutput = {
2104
- $metadata: deserializeMetadata(output),
2105
- DataSets: undefined,
2106
- NextToken: undefined,
2107
- };
2108
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2109
- if (data.DataSets !== undefined && data.DataSets !== null) {
2110
- contents.DataSets = deserializeAws_restJson1ListOfDataSetEntry(data.DataSets, context);
2111
- }
2112
- if (data.NextToken !== undefined && data.NextToken !== null) {
2113
- contents.NextToken = __expectString(data.NextToken);
2114
- }
2115
- return Promise.resolve(contents);
2116
- };
2117
-
2118
- const deserializeAws_restJson1ListDataSetsCommandError = async (
2119
- output: __HttpResponse,
2120
- context: __SerdeContext
2121
- ): Promise<ListDataSetsCommandOutput> => {
2122
- const parsedOutput: any = {
2123
- ...output,
2124
- body: await parseBody(output.body, context),
2125
- };
2126
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2127
- let errorCode: string = "UnknownError";
2128
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2129
- switch (errorCode) {
2130
- case "InternalServerException":
2131
- case "com.amazonaws.dataexchange#InternalServerException":
2132
- response = {
2133
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2134
- name: errorCode,
2135
- $metadata: deserializeMetadata(output),
2136
- };
2137
- break;
2138
- case "ResourceNotFoundException":
2139
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2140
- response = {
2141
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2142
- name: errorCode,
2143
- $metadata: deserializeMetadata(output),
2144
- };
2145
- break;
2146
- case "ThrottlingException":
2147
- case "com.amazonaws.dataexchange#ThrottlingException":
2148
- response = {
2149
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2150
- name: errorCode,
2151
- $metadata: deserializeMetadata(output),
2152
- };
2153
- break;
2154
- case "ValidationException":
2155
- case "com.amazonaws.dataexchange#ValidationException":
2156
- response = {
2157
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2158
- name: errorCode,
2159
- $metadata: deserializeMetadata(output),
2160
- };
2161
- break;
2162
- default:
2163
- const parsedBody = parsedOutput.body;
2164
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2165
- response = {
2166
- ...parsedBody,
2167
- name: `${errorCode}`,
2168
- message: parsedBody.message || parsedBody.Message || errorCode,
2169
- $fault: "client",
2170
- $metadata: deserializeMetadata(output),
2171
- } as any;
2172
- }
2173
- const message = response.message || response.Message || errorCode;
2174
- response.message = message;
2175
- delete response.Message;
2176
- return Promise.reject(Object.assign(new Error(message), response));
2177
- };
2178
-
2179
- export const deserializeAws_restJson1ListJobsCommand = async (
2180
- output: __HttpResponse,
2181
- context: __SerdeContext
2182
- ): Promise<ListJobsCommandOutput> => {
2183
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2184
- return deserializeAws_restJson1ListJobsCommandError(output, context);
2185
- }
2186
- const contents: ListJobsCommandOutput = {
2187
- $metadata: deserializeMetadata(output),
2188
- Jobs: undefined,
2189
- NextToken: undefined,
2190
- };
2191
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2192
- if (data.Jobs !== undefined && data.Jobs !== null) {
2193
- contents.Jobs = deserializeAws_restJson1ListOfJobEntry(data.Jobs, context);
2194
- }
2195
- if (data.NextToken !== undefined && data.NextToken !== null) {
2196
- contents.NextToken = __expectString(data.NextToken);
2197
- }
2198
- return Promise.resolve(contents);
2199
- };
2200
-
2201
- const deserializeAws_restJson1ListJobsCommandError = async (
2202
- output: __HttpResponse,
2203
- context: __SerdeContext
2204
- ): Promise<ListJobsCommandOutput> => {
2205
- const parsedOutput: any = {
2206
- ...output,
2207
- body: await parseBody(output.body, context),
2208
- };
2209
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2210
- let errorCode: string = "UnknownError";
2211
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2212
- switch (errorCode) {
2213
- case "InternalServerException":
2214
- case "com.amazonaws.dataexchange#InternalServerException":
2215
- response = {
2216
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2217
- name: errorCode,
2218
- $metadata: deserializeMetadata(output),
2219
- };
2220
- break;
2221
- case "ResourceNotFoundException":
2222
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2223
- response = {
2224
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2225
- name: errorCode,
2226
- $metadata: deserializeMetadata(output),
2227
- };
2228
- break;
2229
- case "ThrottlingException":
2230
- case "com.amazonaws.dataexchange#ThrottlingException":
2231
- response = {
2232
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2233
- name: errorCode,
2234
- $metadata: deserializeMetadata(output),
2235
- };
2236
- break;
2237
- case "ValidationException":
2238
- case "com.amazonaws.dataexchange#ValidationException":
2239
- response = {
2240
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2241
- name: errorCode,
2242
- $metadata: deserializeMetadata(output),
2243
- };
2244
- break;
2245
- default:
2246
- const parsedBody = parsedOutput.body;
2247
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2248
- response = {
2249
- ...parsedBody,
2250
- name: `${errorCode}`,
2251
- message: parsedBody.message || parsedBody.Message || errorCode,
2252
- $fault: "client",
2253
- $metadata: deserializeMetadata(output),
2254
- } as any;
2255
- }
2256
- const message = response.message || response.Message || errorCode;
2257
- response.message = message;
2258
- delete response.Message;
2259
- return Promise.reject(Object.assign(new Error(message), response));
2260
- };
2261
-
2262
- export const deserializeAws_restJson1ListRevisionAssetsCommand = async (
2263
- output: __HttpResponse,
2264
- context: __SerdeContext
2265
- ): Promise<ListRevisionAssetsCommandOutput> => {
2266
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2267
- return deserializeAws_restJson1ListRevisionAssetsCommandError(output, context);
2268
- }
2269
- const contents: ListRevisionAssetsCommandOutput = {
2270
- $metadata: deserializeMetadata(output),
2271
- Assets: undefined,
2272
- NextToken: undefined,
2273
- };
2274
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2275
- if (data.Assets !== undefined && data.Assets !== null) {
2276
- contents.Assets = deserializeAws_restJson1ListOfAssetEntry(data.Assets, context);
2277
- }
2278
- if (data.NextToken !== undefined && data.NextToken !== null) {
2279
- contents.NextToken = __expectString(data.NextToken);
2280
- }
2281
- return Promise.resolve(contents);
2282
- };
2283
-
2284
- const deserializeAws_restJson1ListRevisionAssetsCommandError = async (
2285
- output: __HttpResponse,
2286
- context: __SerdeContext
2287
- ): Promise<ListRevisionAssetsCommandOutput> => {
2288
- const parsedOutput: any = {
2289
- ...output,
2290
- body: await parseBody(output.body, context),
2291
- };
2292
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2293
- let errorCode: string = "UnknownError";
2294
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2295
- switch (errorCode) {
2296
- case "InternalServerException":
2297
- case "com.amazonaws.dataexchange#InternalServerException":
2298
- response = {
2299
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2300
- name: errorCode,
2301
- $metadata: deserializeMetadata(output),
2302
- };
2303
- break;
2304
- case "ResourceNotFoundException":
2305
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2306
- response = {
2307
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2308
- name: errorCode,
2309
- $metadata: deserializeMetadata(output),
2310
- };
2311
- break;
2312
- case "ThrottlingException":
2313
- case "com.amazonaws.dataexchange#ThrottlingException":
2314
- response = {
2315
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2316
- name: errorCode,
2317
- $metadata: deserializeMetadata(output),
2318
- };
2319
- break;
2320
- case "ValidationException":
2321
- case "com.amazonaws.dataexchange#ValidationException":
2322
- response = {
2323
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2324
- name: errorCode,
2325
- $metadata: deserializeMetadata(output),
2326
- };
2327
- break;
2328
- default:
2329
- const parsedBody = parsedOutput.body;
2330
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2331
- response = {
2332
- ...parsedBody,
2333
- name: `${errorCode}`,
2334
- message: parsedBody.message || parsedBody.Message || errorCode,
2335
- $fault: "client",
2336
- $metadata: deserializeMetadata(output),
2337
- } as any;
2338
- }
2339
- const message = response.message || response.Message || errorCode;
2340
- response.message = message;
2341
- delete response.Message;
2342
- return Promise.reject(Object.assign(new Error(message), response));
2343
- };
2344
-
2345
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (
2346
- output: __HttpResponse,
2347
- context: __SerdeContext
2348
- ): Promise<ListTagsForResourceCommandOutput> => {
2349
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2350
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2351
- }
2352
- const contents: ListTagsForResourceCommandOutput = {
2353
- $metadata: deserializeMetadata(output),
2354
- Tags: undefined,
2355
- };
2356
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2357
- if (data.tags !== undefined && data.tags !== null) {
2358
- contents.Tags = deserializeAws_restJson1MapOf__string(data.tags, context);
2359
- }
2360
- return Promise.resolve(contents);
2361
- };
2362
-
2363
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (
2364
- output: __HttpResponse,
2365
- context: __SerdeContext
2366
- ): Promise<ListTagsForResourceCommandOutput> => {
2367
- const parsedOutput: any = {
2368
- ...output,
2369
- body: await parseBody(output.body, context),
2370
- };
2371
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2372
- let errorCode: string = "UnknownError";
2373
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2374
- switch (errorCode) {
2375
- default:
2376
- const parsedBody = parsedOutput.body;
2377
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2378
- response = {
2379
- ...parsedBody,
2380
- name: `${errorCode}`,
2381
- message: parsedBody.message || parsedBody.Message || errorCode,
2382
- $fault: "client",
2383
- $metadata: deserializeMetadata(output),
2384
- } as any;
2385
- }
2386
- const message = response.message || response.Message || errorCode;
2387
- response.message = message;
2388
- delete response.Message;
2389
- return Promise.reject(Object.assign(new Error(message), response));
2390
- };
2391
-
2392
- export const deserializeAws_restJson1StartJobCommand = async (
2393
- output: __HttpResponse,
2394
- context: __SerdeContext
2395
- ): Promise<StartJobCommandOutput> => {
2396
- if (output.statusCode !== 202 && output.statusCode >= 300) {
2397
- return deserializeAws_restJson1StartJobCommandError(output, context);
2398
- }
2399
- const contents: StartJobCommandOutput = {
2400
- $metadata: deserializeMetadata(output),
2401
- };
2402
- await collectBody(output.body, context);
2403
- return Promise.resolve(contents);
2404
- };
2405
-
2406
- const deserializeAws_restJson1StartJobCommandError = async (
2407
- output: __HttpResponse,
2408
- context: __SerdeContext
2409
- ): Promise<StartJobCommandOutput> => {
2410
- const parsedOutput: any = {
2411
- ...output,
2412
- body: await parseBody(output.body, context),
2413
- };
2414
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2415
- let errorCode: string = "UnknownError";
2416
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2417
- switch (errorCode) {
2418
- case "AccessDeniedException":
2419
- case "com.amazonaws.dataexchange#AccessDeniedException":
2420
- response = {
2421
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2422
- name: errorCode,
2423
- $metadata: deserializeMetadata(output),
2424
- };
2425
- break;
2426
- case "ConflictException":
2427
- case "com.amazonaws.dataexchange#ConflictException":
2428
- response = {
2429
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2430
- name: errorCode,
2431
- $metadata: deserializeMetadata(output),
2432
- };
2433
- break;
2434
- case "InternalServerException":
2435
- case "com.amazonaws.dataexchange#InternalServerException":
2436
- response = {
2437
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2438
- name: errorCode,
2439
- $metadata: deserializeMetadata(output),
2440
- };
2441
- break;
2442
- case "ResourceNotFoundException":
2443
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2444
- response = {
2445
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2446
- name: errorCode,
2447
- $metadata: deserializeMetadata(output),
2448
- };
2449
- break;
2450
- case "ThrottlingException":
2451
- case "com.amazonaws.dataexchange#ThrottlingException":
2452
- response = {
2453
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2454
- name: errorCode,
2455
- $metadata: deserializeMetadata(output),
2456
- };
2457
- break;
2458
- case "ValidationException":
2459
- case "com.amazonaws.dataexchange#ValidationException":
2460
- response = {
2461
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2462
- name: errorCode,
2463
- $metadata: deserializeMetadata(output),
2464
- };
2465
- break;
2466
- default:
2467
- const parsedBody = parsedOutput.body;
2468
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2469
- response = {
2470
- ...parsedBody,
2471
- name: `${errorCode}`,
2472
- message: parsedBody.message || parsedBody.Message || errorCode,
2473
- $fault: "client",
2474
- $metadata: deserializeMetadata(output),
2475
- } as any;
2476
- }
2477
- const message = response.message || response.Message || errorCode;
2478
- response.message = message;
2479
- delete response.Message;
2480
- return Promise.reject(Object.assign(new Error(message), response));
2481
- };
2482
-
2483
- export const deserializeAws_restJson1TagResourceCommand = async (
2484
- output: __HttpResponse,
2485
- context: __SerdeContext
2486
- ): Promise<TagResourceCommandOutput> => {
2487
- if (output.statusCode !== 204 && output.statusCode >= 300) {
2488
- return deserializeAws_restJson1TagResourceCommandError(output, context);
2489
- }
2490
- const contents: TagResourceCommandOutput = {
2491
- $metadata: deserializeMetadata(output),
2492
- };
2493
- await collectBody(output.body, context);
2494
- return Promise.resolve(contents);
2495
- };
2496
-
2497
- const deserializeAws_restJson1TagResourceCommandError = async (
2498
- output: __HttpResponse,
2499
- context: __SerdeContext
2500
- ): Promise<TagResourceCommandOutput> => {
2501
- const parsedOutput: any = {
2502
- ...output,
2503
- body: await parseBody(output.body, context),
2504
- };
2505
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2506
- let errorCode: string = "UnknownError";
2507
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2508
- switch (errorCode) {
2509
- default:
2510
- const parsedBody = parsedOutput.body;
2511
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2512
- response = {
2513
- ...parsedBody,
2514
- name: `${errorCode}`,
2515
- message: parsedBody.message || parsedBody.Message || errorCode,
2516
- $fault: "client",
2517
- $metadata: deserializeMetadata(output),
2518
- } as any;
2519
- }
2520
- const message = response.message || response.Message || errorCode;
2521
- response.message = message;
2522
- delete response.Message;
2523
- return Promise.reject(Object.assign(new Error(message), response));
2524
- };
2525
-
2526
- export const deserializeAws_restJson1UntagResourceCommand = async (
2527
- output: __HttpResponse,
2528
- context: __SerdeContext
2529
- ): Promise<UntagResourceCommandOutput> => {
2530
- if (output.statusCode !== 204 && output.statusCode >= 300) {
2531
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
2532
- }
2533
- const contents: UntagResourceCommandOutput = {
2534
- $metadata: deserializeMetadata(output),
2535
- };
2536
- await collectBody(output.body, context);
2537
- return Promise.resolve(contents);
2538
- };
2539
-
2540
- const deserializeAws_restJson1UntagResourceCommandError = async (
2541
- output: __HttpResponse,
2542
- context: __SerdeContext
2543
- ): Promise<UntagResourceCommandOutput> => {
2544
- const parsedOutput: any = {
2545
- ...output,
2546
- body: await parseBody(output.body, context),
2547
- };
2548
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2549
- let errorCode: string = "UnknownError";
2550
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2551
- switch (errorCode) {
2552
- default:
2553
- const parsedBody = parsedOutput.body;
2554
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2555
- response = {
2556
- ...parsedBody,
2557
- name: `${errorCode}`,
2558
- message: parsedBody.message || parsedBody.Message || errorCode,
2559
- $fault: "client",
2560
- $metadata: deserializeMetadata(output),
2561
- } as any;
2562
- }
2563
- const message = response.message || response.Message || errorCode;
2564
- response.message = message;
2565
- delete response.Message;
2566
- return Promise.reject(Object.assign(new Error(message), response));
2567
- };
2568
-
2569
- export const deserializeAws_restJson1UpdateAssetCommand = async (
2570
- output: __HttpResponse,
2571
- context: __SerdeContext
2572
- ): Promise<UpdateAssetCommandOutput> => {
2573
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2574
- return deserializeAws_restJson1UpdateAssetCommandError(output, context);
2575
- }
2576
- const contents: UpdateAssetCommandOutput = {
2577
- $metadata: deserializeMetadata(output),
2578
- Arn: undefined,
2579
- AssetDetails: undefined,
2580
- AssetType: undefined,
2581
- CreatedAt: undefined,
2582
- DataSetId: undefined,
2583
- Id: undefined,
2584
- Name: undefined,
2585
- RevisionId: undefined,
2586
- SourceId: undefined,
2587
- UpdatedAt: undefined,
2588
- };
2589
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2590
- if (data.Arn !== undefined && data.Arn !== null) {
2591
- contents.Arn = __expectString(data.Arn);
2592
- }
2593
- if (data.AssetDetails !== undefined && data.AssetDetails !== null) {
2594
- contents.AssetDetails = deserializeAws_restJson1AssetDetails(data.AssetDetails, context);
2595
- }
2596
- if (data.AssetType !== undefined && data.AssetType !== null) {
2597
- contents.AssetType = __expectString(data.AssetType);
2598
- }
2599
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2600
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
2601
- }
2602
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
2603
- contents.DataSetId = __expectString(data.DataSetId);
2604
- }
2605
- if (data.Id !== undefined && data.Id !== null) {
2606
- contents.Id = __expectString(data.Id);
2607
- }
2608
- if (data.Name !== undefined && data.Name !== null) {
2609
- contents.Name = __expectString(data.Name);
2610
- }
2611
- if (data.RevisionId !== undefined && data.RevisionId !== null) {
2612
- contents.RevisionId = __expectString(data.RevisionId);
2613
- }
2614
- if (data.SourceId !== undefined && data.SourceId !== null) {
2615
- contents.SourceId = __expectString(data.SourceId);
2616
- }
2617
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
2618
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
2619
- }
2620
- return Promise.resolve(contents);
2621
- };
2622
-
2623
- const deserializeAws_restJson1UpdateAssetCommandError = async (
2624
- output: __HttpResponse,
2625
- context: __SerdeContext
2626
- ): Promise<UpdateAssetCommandOutput> => {
2627
- const parsedOutput: any = {
2628
- ...output,
2629
- body: await parseBody(output.body, context),
2630
- };
2631
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2632
- let errorCode: string = "UnknownError";
2633
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2634
- switch (errorCode) {
2635
- case "AccessDeniedException":
2636
- case "com.amazonaws.dataexchange#AccessDeniedException":
2637
- response = {
2638
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2639
- name: errorCode,
2640
- $metadata: deserializeMetadata(output),
2641
- };
2642
- break;
2643
- case "ConflictException":
2644
- case "com.amazonaws.dataexchange#ConflictException":
2645
- response = {
2646
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2647
- name: errorCode,
2648
- $metadata: deserializeMetadata(output),
2649
- };
2650
- break;
2651
- case "InternalServerException":
2652
- case "com.amazonaws.dataexchange#InternalServerException":
2653
- response = {
2654
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2655
- name: errorCode,
2656
- $metadata: deserializeMetadata(output),
2657
- };
2658
- break;
2659
- case "ResourceNotFoundException":
2660
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2661
- response = {
2662
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2663
- name: errorCode,
2664
- $metadata: deserializeMetadata(output),
2665
- };
2666
- break;
2667
- case "ThrottlingException":
2668
- case "com.amazonaws.dataexchange#ThrottlingException":
2669
- response = {
2670
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2671
- name: errorCode,
2672
- $metadata: deserializeMetadata(output),
2673
- };
2674
- break;
2675
- case "ValidationException":
2676
- case "com.amazonaws.dataexchange#ValidationException":
2677
- response = {
2678
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2679
- name: errorCode,
2680
- $metadata: deserializeMetadata(output),
2681
- };
2682
- break;
2683
- default:
2684
- const parsedBody = parsedOutput.body;
2685
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2686
- response = {
2687
- ...parsedBody,
2688
- name: `${errorCode}`,
2689
- message: parsedBody.message || parsedBody.Message || errorCode,
2690
- $fault: "client",
2691
- $metadata: deserializeMetadata(output),
2692
- } as any;
2693
- }
2694
- const message = response.message || response.Message || errorCode;
2695
- response.message = message;
2696
- delete response.Message;
2697
- return Promise.reject(Object.assign(new Error(message), response));
2698
- };
2699
-
2700
- export const deserializeAws_restJson1UpdateDataSetCommand = async (
2701
- output: __HttpResponse,
2702
- context: __SerdeContext
2703
- ): Promise<UpdateDataSetCommandOutput> => {
2704
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2705
- return deserializeAws_restJson1UpdateDataSetCommandError(output, context);
2706
- }
2707
- const contents: UpdateDataSetCommandOutput = {
2708
- $metadata: deserializeMetadata(output),
2709
- Arn: undefined,
2710
- AssetType: undefined,
2711
- CreatedAt: undefined,
2712
- Description: undefined,
2713
- Id: undefined,
2714
- Name: undefined,
2715
- Origin: undefined,
2716
- OriginDetails: undefined,
2717
- SourceId: undefined,
2718
- UpdatedAt: undefined,
2719
- };
2720
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2721
- if (data.Arn !== undefined && data.Arn !== null) {
2722
- contents.Arn = __expectString(data.Arn);
2723
- }
2724
- if (data.AssetType !== undefined && data.AssetType !== null) {
2725
- contents.AssetType = __expectString(data.AssetType);
2726
- }
2727
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2728
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
2729
- }
2730
- if (data.Description !== undefined && data.Description !== null) {
2731
- contents.Description = __expectString(data.Description);
2732
- }
2733
- if (data.Id !== undefined && data.Id !== null) {
2734
- contents.Id = __expectString(data.Id);
2735
- }
2736
- if (data.Name !== undefined && data.Name !== null) {
2737
- contents.Name = __expectString(data.Name);
2738
- }
2739
- if (data.Origin !== undefined && data.Origin !== null) {
2740
- contents.Origin = __expectString(data.Origin);
2741
- }
2742
- if (data.OriginDetails !== undefined && data.OriginDetails !== null) {
2743
- contents.OriginDetails = deserializeAws_restJson1OriginDetails(data.OriginDetails, context);
2744
- }
2745
- if (data.SourceId !== undefined && data.SourceId !== null) {
2746
- contents.SourceId = __expectString(data.SourceId);
2747
- }
2748
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
2749
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
2750
- }
2751
- return Promise.resolve(contents);
2752
- };
2753
-
2754
- const deserializeAws_restJson1UpdateDataSetCommandError = async (
2755
- output: __HttpResponse,
2756
- context: __SerdeContext
2757
- ): Promise<UpdateDataSetCommandOutput> => {
2758
- const parsedOutput: any = {
2759
- ...output,
2760
- body: await parseBody(output.body, context),
2761
- };
2762
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2763
- let errorCode: string = "UnknownError";
2764
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2765
- switch (errorCode) {
2766
- case "AccessDeniedException":
2767
- case "com.amazonaws.dataexchange#AccessDeniedException":
2768
- response = {
2769
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2770
- name: errorCode,
2771
- $metadata: deserializeMetadata(output),
2772
- };
2773
- break;
2774
- case "InternalServerException":
2775
- case "com.amazonaws.dataexchange#InternalServerException":
2776
- response = {
2777
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2778
- name: errorCode,
2779
- $metadata: deserializeMetadata(output),
2780
- };
2781
- break;
2782
- case "ResourceNotFoundException":
2783
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2784
- response = {
2785
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2786
- name: errorCode,
2787
- $metadata: deserializeMetadata(output),
2788
- };
2789
- break;
2790
- case "ThrottlingException":
2791
- case "com.amazonaws.dataexchange#ThrottlingException":
2792
- response = {
2793
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2794
- name: errorCode,
2795
- $metadata: deserializeMetadata(output),
2796
- };
2797
- break;
2798
- case "ValidationException":
2799
- case "com.amazonaws.dataexchange#ValidationException":
2800
- response = {
2801
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2802
- name: errorCode,
2803
- $metadata: deserializeMetadata(output),
2804
- };
2805
- break;
2806
- default:
2807
- const parsedBody = parsedOutput.body;
2808
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2809
- response = {
2810
- ...parsedBody,
2811
- name: `${errorCode}`,
2812
- message: parsedBody.message || parsedBody.Message || errorCode,
2813
- $fault: "client",
2814
- $metadata: deserializeMetadata(output),
2815
- } as any;
2816
- }
2817
- const message = response.message || response.Message || errorCode;
2818
- response.message = message;
2819
- delete response.Message;
2820
- return Promise.reject(Object.assign(new Error(message), response));
2821
- };
2822
-
2823
- export const deserializeAws_restJson1UpdateRevisionCommand = async (
2824
- output: __HttpResponse,
2825
- context: __SerdeContext
2826
- ): Promise<UpdateRevisionCommandOutput> => {
2827
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2828
- return deserializeAws_restJson1UpdateRevisionCommandError(output, context);
2829
- }
2830
- const contents: UpdateRevisionCommandOutput = {
2831
- $metadata: deserializeMetadata(output),
2832
- Arn: undefined,
2833
- Comment: undefined,
2834
- CreatedAt: undefined,
2835
- DataSetId: undefined,
2836
- Finalized: undefined,
2837
- Id: undefined,
2838
- SourceId: undefined,
2839
- UpdatedAt: undefined,
2840
- };
2841
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2842
- if (data.Arn !== undefined && data.Arn !== null) {
2843
- contents.Arn = __expectString(data.Arn);
2844
- }
2845
- if (data.Comment !== undefined && data.Comment !== null) {
2846
- contents.Comment = __expectString(data.Comment);
2847
- }
2848
- if (data.CreatedAt !== undefined && data.CreatedAt !== null) {
2849
- contents.CreatedAt = __expectNonNull(__parseRfc3339DateTime(data.CreatedAt));
2850
- }
2851
- if (data.DataSetId !== undefined && data.DataSetId !== null) {
2852
- contents.DataSetId = __expectString(data.DataSetId);
2853
- }
2854
- if (data.Finalized !== undefined && data.Finalized !== null) {
2855
- contents.Finalized = __expectBoolean(data.Finalized);
2856
- }
2857
- if (data.Id !== undefined && data.Id !== null) {
2858
- contents.Id = __expectString(data.Id);
2859
- }
2860
- if (data.SourceId !== undefined && data.SourceId !== null) {
2861
- contents.SourceId = __expectString(data.SourceId);
2862
- }
2863
- if (data.UpdatedAt !== undefined && data.UpdatedAt !== null) {
2864
- contents.UpdatedAt = __expectNonNull(__parseRfc3339DateTime(data.UpdatedAt));
2865
- }
2866
- return Promise.resolve(contents);
2867
- };
2868
-
2869
- const deserializeAws_restJson1UpdateRevisionCommandError = async (
2870
- output: __HttpResponse,
2871
- context: __SerdeContext
2872
- ): Promise<UpdateRevisionCommandOutput> => {
2873
- const parsedOutput: any = {
2874
- ...output,
2875
- body: await parseBody(output.body, context),
2876
- };
2877
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2878
- let errorCode: string = "UnknownError";
2879
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2880
- switch (errorCode) {
2881
- case "AccessDeniedException":
2882
- case "com.amazonaws.dataexchange#AccessDeniedException":
2883
- response = {
2884
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2885
- name: errorCode,
2886
- $metadata: deserializeMetadata(output),
2887
- };
2888
- break;
2889
- case "ConflictException":
2890
- case "com.amazonaws.dataexchange#ConflictException":
2891
- response = {
2892
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2893
- name: errorCode,
2894
- $metadata: deserializeMetadata(output),
2895
- };
2896
- break;
2897
- case "InternalServerException":
2898
- case "com.amazonaws.dataexchange#InternalServerException":
2899
- response = {
2900
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2901
- name: errorCode,
2902
- $metadata: deserializeMetadata(output),
2903
- };
2904
- break;
2905
- case "ResourceNotFoundException":
2906
- case "com.amazonaws.dataexchange#ResourceNotFoundException":
2907
- response = {
2908
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2909
- name: errorCode,
2910
- $metadata: deserializeMetadata(output),
2911
- };
2912
- break;
2913
- case "ThrottlingException":
2914
- case "com.amazonaws.dataexchange#ThrottlingException":
2915
- response = {
2916
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2917
- name: errorCode,
2918
- $metadata: deserializeMetadata(output),
2919
- };
2920
- break;
2921
- case "ValidationException":
2922
- case "com.amazonaws.dataexchange#ValidationException":
2923
- response = {
2924
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2925
- name: errorCode,
2926
- $metadata: deserializeMetadata(output),
2927
- };
2928
- break;
2929
- default:
2930
- const parsedBody = parsedOutput.body;
2931
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2932
- response = {
2933
- ...parsedBody,
2934
- name: `${errorCode}`,
2935
- message: parsedBody.message || parsedBody.Message || errorCode,
2936
- $fault: "client",
2937
- $metadata: deserializeMetadata(output),
2938
- } as any;
2939
- }
2940
- const message = response.message || response.Message || errorCode;
2941
- response.message = message;
2942
- delete response.Message;
2943
- return Promise.reject(Object.assign(new Error(message), response));
2944
- };
2945
-
2946
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
2947
- parsedOutput: any,
2948
- context: __SerdeContext
2949
- ): Promise<AccessDeniedException> => {
2950
- const contents: AccessDeniedException = {
2951
- name: "AccessDeniedException",
2952
- $fault: "client",
2953
- $metadata: deserializeMetadata(parsedOutput),
2954
- Message: undefined,
2955
- };
2956
- const data: any = parsedOutput.body;
2957
- if (data.Message !== undefined && data.Message !== null) {
2958
- contents.Message = __expectString(data.Message);
2959
- }
2960
- return contents;
2961
- };
2962
-
2963
- const deserializeAws_restJson1ConflictExceptionResponse = async (
2964
- parsedOutput: any,
2965
- context: __SerdeContext
2966
- ): Promise<ConflictException> => {
2967
- const contents: ConflictException = {
2968
- name: "ConflictException",
2969
- $fault: "client",
2970
- $metadata: deserializeMetadata(parsedOutput),
2971
- Message: undefined,
2972
- ResourceId: undefined,
2973
- ResourceType: undefined,
2974
- };
2975
- const data: any = parsedOutput.body;
2976
- if (data.Message !== undefined && data.Message !== null) {
2977
- contents.Message = __expectString(data.Message);
2978
- }
2979
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
2980
- contents.ResourceId = __expectString(data.ResourceId);
2981
- }
2982
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
2983
- contents.ResourceType = __expectString(data.ResourceType);
2984
- }
2985
- return contents;
2986
- };
2987
-
2988
- const deserializeAws_restJson1InternalServerExceptionResponse = async (
2989
- parsedOutput: any,
2990
- context: __SerdeContext
2991
- ): Promise<InternalServerException> => {
2992
- const contents: InternalServerException = {
2993
- name: "InternalServerException",
2994
- $fault: "server",
2995
- $metadata: deserializeMetadata(parsedOutput),
2996
- Message: undefined,
2997
- };
2998
- const data: any = parsedOutput.body;
2999
- if (data.Message !== undefined && data.Message !== null) {
3000
- contents.Message = __expectString(data.Message);
3001
- }
3002
- return contents;
3003
- };
3004
-
3005
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
3006
- parsedOutput: any,
3007
- context: __SerdeContext
3008
- ): Promise<ResourceNotFoundException> => {
3009
- const contents: ResourceNotFoundException = {
3010
- name: "ResourceNotFoundException",
3011
- $fault: "client",
3012
- $metadata: deserializeMetadata(parsedOutput),
3013
- Message: undefined,
3014
- ResourceId: undefined,
3015
- ResourceType: undefined,
3016
- };
3017
- const data: any = parsedOutput.body;
3018
- if (data.Message !== undefined && data.Message !== null) {
3019
- contents.Message = __expectString(data.Message);
3020
- }
3021
- if (data.ResourceId !== undefined && data.ResourceId !== null) {
3022
- contents.ResourceId = __expectString(data.ResourceId);
3023
- }
3024
- if (data.ResourceType !== undefined && data.ResourceType !== null) {
3025
- contents.ResourceType = __expectString(data.ResourceType);
3026
- }
3027
- return contents;
3028
- };
3029
-
3030
- const deserializeAws_restJson1ServiceLimitExceededExceptionResponse = async (
3031
- parsedOutput: any,
3032
- context: __SerdeContext
3033
- ): Promise<ServiceLimitExceededException> => {
3034
- const contents: ServiceLimitExceededException = {
3035
- name: "ServiceLimitExceededException",
3036
- $fault: "client",
3037
- $metadata: deserializeMetadata(parsedOutput),
3038
- LimitName: undefined,
3039
- LimitValue: undefined,
3040
- Message: undefined,
3041
- };
3042
- const data: any = parsedOutput.body;
3043
- if (data.LimitName !== undefined && data.LimitName !== null) {
3044
- contents.LimitName = __expectString(data.LimitName);
3045
- }
3046
- if (data.LimitValue !== undefined && data.LimitValue !== null) {
3047
- contents.LimitValue = __limitedParseDouble(data.LimitValue);
3048
- }
3049
- if (data.Message !== undefined && data.Message !== null) {
3050
- contents.Message = __expectString(data.Message);
3051
- }
3052
- return contents;
3053
- };
3054
-
3055
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (
3056
- parsedOutput: any,
3057
- context: __SerdeContext
3058
- ): Promise<ThrottlingException> => {
3059
- const contents: ThrottlingException = {
3060
- name: "ThrottlingException",
3061
- $fault: "client",
3062
- $metadata: deserializeMetadata(parsedOutput),
3063
- Message: undefined,
3064
- };
3065
- const data: any = parsedOutput.body;
3066
- if (data.Message !== undefined && data.Message !== null) {
3067
- contents.Message = __expectString(data.Message);
3068
- }
3069
- return contents;
3070
- };
3071
-
3072
- const deserializeAws_restJson1ValidationExceptionResponse = async (
3073
- parsedOutput: any,
3074
- context: __SerdeContext
3075
- ): Promise<ValidationException> => {
3076
- const contents: ValidationException = {
3077
- name: "ValidationException",
3078
- $fault: "client",
3079
- $metadata: deserializeMetadata(parsedOutput),
3080
- Message: undefined,
3081
- };
3082
- const data: any = parsedOutput.body;
3083
- if (data.Message !== undefined && data.Message !== null) {
3084
- contents.Message = __expectString(data.Message);
3085
- }
3086
- return contents;
3087
- };
3088
-
3089
- const serializeAws_restJson1AssetDestinationEntry = (input: AssetDestinationEntry, context: __SerdeContext): any => {
3090
- return {
3091
- ...(input.AssetId !== undefined && input.AssetId !== null && { AssetId: input.AssetId }),
3092
- ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }),
3093
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
3094
- };
3095
- };
3096
-
3097
- const serializeAws_restJson1AssetSourceEntry = (input: AssetSourceEntry, context: __SerdeContext): any => {
3098
- return {
3099
- ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }),
3100
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
3101
- };
3102
- };
3103
-
3104
- const serializeAws_restJson1ExportAssetsToS3RequestDetails = (
3105
- input: ExportAssetsToS3RequestDetails,
3106
- context: __SerdeContext
3107
- ): any => {
3108
- return {
3109
- ...(input.AssetDestinations !== undefined &&
3110
- input.AssetDestinations !== null && {
3111
- AssetDestinations: serializeAws_restJson1ListOfAssetDestinationEntry(input.AssetDestinations, context),
3112
- }),
3113
- ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }),
3114
- ...(input.Encryption !== undefined &&
3115
- input.Encryption !== null && {
3116
- Encryption: serializeAws_restJson1ExportServerSideEncryption(input.Encryption, context),
3117
- }),
3118
- ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }),
3119
- };
3120
- };
3121
-
3122
- const serializeAws_restJson1ExportAssetToSignedUrlRequestDetails = (
3123
- input: ExportAssetToSignedUrlRequestDetails,
3124
- context: __SerdeContext
3125
- ): any => {
3126
- return {
3127
- ...(input.AssetId !== undefined && input.AssetId !== null && { AssetId: input.AssetId }),
3128
- ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }),
3129
- ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }),
3130
- };
3131
- };
3132
-
3133
- const serializeAws_restJson1ExportRevisionsToS3RequestDetails = (
3134
- input: ExportRevisionsToS3RequestDetails,
3135
- context: __SerdeContext
3136
- ): any => {
3137
- return {
3138
- ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }),
3139
- ...(input.Encryption !== undefined &&
3140
- input.Encryption !== null && {
3141
- Encryption: serializeAws_restJson1ExportServerSideEncryption(input.Encryption, context),
3142
- }),
3143
- ...(input.RevisionDestinations !== undefined &&
3144
- input.RevisionDestinations !== null && {
3145
- RevisionDestinations: serializeAws_restJson1ListOfRevisionDestinationEntry(input.RevisionDestinations, context),
3146
- }),
3147
- };
3148
- };
3149
-
3150
- const serializeAws_restJson1ExportServerSideEncryption = (
3151
- input: ExportServerSideEncryption,
3152
- context: __SerdeContext
3153
- ): any => {
3154
- return {
3155
- ...(input.KmsKeyArn !== undefined && input.KmsKeyArn !== null && { KmsKeyArn: input.KmsKeyArn }),
3156
- ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }),
3157
- };
3158
- };
3159
-
3160
- const serializeAws_restJson1ImportAssetFromSignedUrlRequestDetails = (
3161
- input: ImportAssetFromSignedUrlRequestDetails,
3162
- context: __SerdeContext
3163
- ): any => {
3164
- return {
3165
- ...(input.AssetName !== undefined && input.AssetName !== null && { AssetName: input.AssetName }),
3166
- ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }),
3167
- ...(input.Md5Hash !== undefined && input.Md5Hash !== null && { Md5Hash: input.Md5Hash }),
3168
- ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }),
3169
- };
3170
- };
3171
-
3172
- const serializeAws_restJson1ImportAssetsFromS3RequestDetails = (
3173
- input: ImportAssetsFromS3RequestDetails,
3174
- context: __SerdeContext
3175
- ): any => {
3176
- return {
3177
- ...(input.AssetSources !== undefined &&
3178
- input.AssetSources !== null && {
3179
- AssetSources: serializeAws_restJson1ListOfAssetSourceEntry(input.AssetSources, context),
3180
- }),
3181
- ...(input.DataSetId !== undefined && input.DataSetId !== null && { DataSetId: input.DataSetId }),
3182
- ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }),
3183
- };
3184
- };
3185
-
3186
- const serializeAws_restJson1ListOfAssetDestinationEntry = (
3187
- input: AssetDestinationEntry[],
3188
- context: __SerdeContext
3189
- ): any => {
3190
- return input
3191
- .filter((e: any) => e != null)
3192
- .map((entry) => {
3193
- if (entry === null) {
3194
- return null as any;
3195
- }
3196
- return serializeAws_restJson1AssetDestinationEntry(entry, context);
3197
- });
3198
- };
3199
-
3200
- const serializeAws_restJson1ListOfAssetSourceEntry = (input: AssetSourceEntry[], context: __SerdeContext): any => {
3201
- return input
3202
- .filter((e: any) => e != null)
3203
- .map((entry) => {
3204
- if (entry === null) {
3205
- return null as any;
3206
- }
3207
- return serializeAws_restJson1AssetSourceEntry(entry, context);
3208
- });
3209
- };
3210
-
3211
- const serializeAws_restJson1ListOfRevisionDestinationEntry = (
3212
- input: RevisionDestinationEntry[],
3213
- context: __SerdeContext
3214
- ): any => {
3215
- return input
3216
- .filter((e: any) => e != null)
3217
- .map((entry) => {
3218
- if (entry === null) {
3219
- return null as any;
3220
- }
3221
- return serializeAws_restJson1RevisionDestinationEntry(entry, context);
3222
- });
3223
- };
3224
-
3225
- const serializeAws_restJson1MapOf__string = (input: { [key: string]: string }, context: __SerdeContext): any => {
3226
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
3227
- if (value === null) {
3228
- return acc;
3229
- }
3230
- return {
3231
- ...acc,
3232
- [key]: value,
3233
- };
3234
- }, {});
3235
- };
3236
-
3237
- const serializeAws_restJson1RequestDetails = (input: RequestDetails, context: __SerdeContext): any => {
3238
- return {
3239
- ...(input.ExportAssetToSignedUrl !== undefined &&
3240
- input.ExportAssetToSignedUrl !== null && {
3241
- ExportAssetToSignedUrl: serializeAws_restJson1ExportAssetToSignedUrlRequestDetails(
3242
- input.ExportAssetToSignedUrl,
3243
- context
3244
- ),
3245
- }),
3246
- ...(input.ExportAssetsToS3 !== undefined &&
3247
- input.ExportAssetsToS3 !== null && {
3248
- ExportAssetsToS3: serializeAws_restJson1ExportAssetsToS3RequestDetails(input.ExportAssetsToS3, context),
3249
- }),
3250
- ...(input.ExportRevisionsToS3 !== undefined &&
3251
- input.ExportRevisionsToS3 !== null && {
3252
- ExportRevisionsToS3: serializeAws_restJson1ExportRevisionsToS3RequestDetails(
3253
- input.ExportRevisionsToS3,
3254
- context
3255
- ),
3256
- }),
3257
- ...(input.ImportAssetFromSignedUrl !== undefined &&
3258
- input.ImportAssetFromSignedUrl !== null && {
3259
- ImportAssetFromSignedUrl: serializeAws_restJson1ImportAssetFromSignedUrlRequestDetails(
3260
- input.ImportAssetFromSignedUrl,
3261
- context
3262
- ),
3263
- }),
3264
- ...(input.ImportAssetsFromS3 !== undefined &&
3265
- input.ImportAssetsFromS3 !== null && {
3266
- ImportAssetsFromS3: serializeAws_restJson1ImportAssetsFromS3RequestDetails(input.ImportAssetsFromS3, context),
3267
- }),
3268
- };
3269
- };
3270
-
3271
- const serializeAws_restJson1RevisionDestinationEntry = (
3272
- input: RevisionDestinationEntry,
3273
- context: __SerdeContext
3274
- ): any => {
3275
- return {
3276
- ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }),
3277
- ...(input.KeyPattern !== undefined && input.KeyPattern !== null && { KeyPattern: input.KeyPattern }),
3278
- ...(input.RevisionId !== undefined && input.RevisionId !== null && { RevisionId: input.RevisionId }),
3279
- };
3280
- };
3281
-
3282
- const deserializeAws_restJson1AssetDestinationEntry = (output: any, context: __SerdeContext): AssetDestinationEntry => {
3283
- return {
3284
- AssetId: __expectString(output.AssetId),
3285
- Bucket: __expectString(output.Bucket),
3286
- Key: __expectString(output.Key),
3287
- } as any;
3288
- };
3289
-
3290
- const deserializeAws_restJson1AssetDetails = (output: any, context: __SerdeContext): AssetDetails => {
3291
- return {
3292
- S3SnapshotAsset:
3293
- output.S3SnapshotAsset !== undefined && output.S3SnapshotAsset !== null
3294
- ? deserializeAws_restJson1S3SnapshotAsset(output.S3SnapshotAsset, context)
3295
- : undefined,
3296
- } as any;
3297
- };
3298
-
3299
- const deserializeAws_restJson1AssetEntry = (output: any, context: __SerdeContext): AssetEntry => {
3300
- return {
3301
- Arn: __expectString(output.Arn),
3302
- AssetDetails:
3303
- output.AssetDetails !== undefined && output.AssetDetails !== null
3304
- ? deserializeAws_restJson1AssetDetails(output.AssetDetails, context)
3305
- : undefined,
3306
- AssetType: __expectString(output.AssetType),
3307
- CreatedAt:
3308
- output.CreatedAt !== undefined && output.CreatedAt !== null
3309
- ? __expectNonNull(__parseRfc3339DateTime(output.CreatedAt))
3310
- : undefined,
3311
- DataSetId: __expectString(output.DataSetId),
3312
- Id: __expectString(output.Id),
3313
- Name: __expectString(output.Name),
3314
- RevisionId: __expectString(output.RevisionId),
3315
- SourceId: __expectString(output.SourceId),
3316
- UpdatedAt:
3317
- output.UpdatedAt !== undefined && output.UpdatedAt !== null
3318
- ? __expectNonNull(__parseRfc3339DateTime(output.UpdatedAt))
3319
- : undefined,
3320
- } as any;
3321
- };
3322
-
3323
- const deserializeAws_restJson1AssetSourceEntry = (output: any, context: __SerdeContext): AssetSourceEntry => {
3324
- return {
3325
- Bucket: __expectString(output.Bucket),
3326
- Key: __expectString(output.Key),
3327
- } as any;
3328
- };
3329
-
3330
- const deserializeAws_restJson1DataSetEntry = (output: any, context: __SerdeContext): DataSetEntry => {
3331
- return {
3332
- Arn: __expectString(output.Arn),
3333
- AssetType: __expectString(output.AssetType),
3334
- CreatedAt:
3335
- output.CreatedAt !== undefined && output.CreatedAt !== null
3336
- ? __expectNonNull(__parseRfc3339DateTime(output.CreatedAt))
3337
- : undefined,
3338
- Description: __expectString(output.Description),
3339
- Id: __expectString(output.Id),
3340
- Name: __expectString(output.Name),
3341
- Origin: __expectString(output.Origin),
3342
- OriginDetails:
3343
- output.OriginDetails !== undefined && output.OriginDetails !== null
3344
- ? deserializeAws_restJson1OriginDetails(output.OriginDetails, context)
3345
- : undefined,
3346
- SourceId: __expectString(output.SourceId),
3347
- UpdatedAt:
3348
- output.UpdatedAt !== undefined && output.UpdatedAt !== null
3349
- ? __expectNonNull(__parseRfc3339DateTime(output.UpdatedAt))
3350
- : undefined,
3351
- } as any;
3352
- };
3353
-
3354
- const deserializeAws_restJson1Details = (output: any, context: __SerdeContext): Details => {
3355
- return {
3356
- ImportAssetFromSignedUrlJobErrorDetails:
3357
- output.ImportAssetFromSignedUrlJobErrorDetails !== undefined &&
3358
- output.ImportAssetFromSignedUrlJobErrorDetails !== null
3359
- ? deserializeAws_restJson1ImportAssetFromSignedUrlJobErrorDetails(
3360
- output.ImportAssetFromSignedUrlJobErrorDetails,
3361
- context
3362
- )
3363
- : undefined,
3364
- ImportAssetsFromS3JobErrorDetails:
3365
- output.ImportAssetsFromS3JobErrorDetails !== undefined && output.ImportAssetsFromS3JobErrorDetails !== null
3366
- ? deserializeAws_restJson1ListOfAssetSourceEntry(output.ImportAssetsFromS3JobErrorDetails, context)
3367
- : undefined,
3368
- } as any;
3369
- };
3370
-
3371
- const deserializeAws_restJson1ExportAssetsToS3ResponseDetails = (
3372
- output: any,
3373
- context: __SerdeContext
3374
- ): ExportAssetsToS3ResponseDetails => {
3375
- return {
3376
- AssetDestinations:
3377
- output.AssetDestinations !== undefined && output.AssetDestinations !== null
3378
- ? deserializeAws_restJson1ListOfAssetDestinationEntry(output.AssetDestinations, context)
3379
- : undefined,
3380
- DataSetId: __expectString(output.DataSetId),
3381
- Encryption:
3382
- output.Encryption !== undefined && output.Encryption !== null
3383
- ? deserializeAws_restJson1ExportServerSideEncryption(output.Encryption, context)
3384
- : undefined,
3385
- RevisionId: __expectString(output.RevisionId),
3386
- } as any;
3387
- };
3388
-
3389
- const deserializeAws_restJson1ExportAssetToSignedUrlResponseDetails = (
3390
- output: any,
3391
- context: __SerdeContext
3392
- ): ExportAssetToSignedUrlResponseDetails => {
3393
- return {
3394
- AssetId: __expectString(output.AssetId),
3395
- DataSetId: __expectString(output.DataSetId),
3396
- RevisionId: __expectString(output.RevisionId),
3397
- SignedUrl: __expectString(output.SignedUrl),
3398
- SignedUrlExpiresAt:
3399
- output.SignedUrlExpiresAt !== undefined && output.SignedUrlExpiresAt !== null
3400
- ? __expectNonNull(__parseRfc3339DateTime(output.SignedUrlExpiresAt))
3401
- : undefined,
3402
- } as any;
3403
- };
3404
-
3405
- const deserializeAws_restJson1ExportRevisionsToS3ResponseDetails = (
3406
- output: any,
3407
- context: __SerdeContext
3408
- ): ExportRevisionsToS3ResponseDetails => {
3409
- return {
3410
- DataSetId: __expectString(output.DataSetId),
3411
- Encryption:
3412
- output.Encryption !== undefined && output.Encryption !== null
3413
- ? deserializeAws_restJson1ExportServerSideEncryption(output.Encryption, context)
3414
- : undefined,
3415
- RevisionDestinations:
3416
- output.RevisionDestinations !== undefined && output.RevisionDestinations !== null
3417
- ? deserializeAws_restJson1ListOfRevisionDestinationEntry(output.RevisionDestinations, context)
3418
- : undefined,
3419
- } as any;
3420
- };
3421
-
3422
- const deserializeAws_restJson1ExportServerSideEncryption = (
3423
- output: any,
3424
- context: __SerdeContext
3425
- ): ExportServerSideEncryption => {
3426
- return {
3427
- KmsKeyArn: __expectString(output.KmsKeyArn),
3428
- Type: __expectString(output.Type),
3429
- } as any;
3430
- };
3431
-
3432
- const deserializeAws_restJson1ImportAssetFromSignedUrlJobErrorDetails = (
3433
- output: any,
3434
- context: __SerdeContext
3435
- ): ImportAssetFromSignedUrlJobErrorDetails => {
3436
- return {
3437
- AssetName: __expectString(output.AssetName),
3438
- } as any;
3439
- };
3440
-
3441
- const deserializeAws_restJson1ImportAssetFromSignedUrlResponseDetails = (
3442
- output: any,
3443
- context: __SerdeContext
3444
- ): ImportAssetFromSignedUrlResponseDetails => {
3445
- return {
3446
- AssetName: __expectString(output.AssetName),
3447
- DataSetId: __expectString(output.DataSetId),
3448
- Md5Hash: __expectString(output.Md5Hash),
3449
- RevisionId: __expectString(output.RevisionId),
3450
- SignedUrl: __expectString(output.SignedUrl),
3451
- SignedUrlExpiresAt:
3452
- output.SignedUrlExpiresAt !== undefined && output.SignedUrlExpiresAt !== null
3453
- ? __expectNonNull(__parseRfc3339DateTime(output.SignedUrlExpiresAt))
3454
- : undefined,
3455
- } as any;
3456
- };
3457
-
3458
- const deserializeAws_restJson1ImportAssetsFromS3ResponseDetails = (
3459
- output: any,
3460
- context: __SerdeContext
3461
- ): ImportAssetsFromS3ResponseDetails => {
3462
- return {
3463
- AssetSources:
3464
- output.AssetSources !== undefined && output.AssetSources !== null
3465
- ? deserializeAws_restJson1ListOfAssetSourceEntry(output.AssetSources, context)
3466
- : undefined,
3467
- DataSetId: __expectString(output.DataSetId),
3468
- RevisionId: __expectString(output.RevisionId),
3469
- } as any;
3470
- };
3471
-
3472
- const deserializeAws_restJson1JobEntry = (output: any, context: __SerdeContext): JobEntry => {
3473
- return {
3474
- Arn: __expectString(output.Arn),
3475
- CreatedAt:
3476
- output.CreatedAt !== undefined && output.CreatedAt !== null
3477
- ? __expectNonNull(__parseRfc3339DateTime(output.CreatedAt))
3478
- : undefined,
3479
- Details:
3480
- output.Details !== undefined && output.Details !== null
3481
- ? deserializeAws_restJson1ResponseDetails(output.Details, context)
3482
- : undefined,
3483
- Errors:
3484
- output.Errors !== undefined && output.Errors !== null
3485
- ? deserializeAws_restJson1ListOfJobError(output.Errors, context)
3486
- : undefined,
3487
- Id: __expectString(output.Id),
3488
- State: __expectString(output.State),
3489
- Type: __expectString(output.Type),
3490
- UpdatedAt:
3491
- output.UpdatedAt !== undefined && output.UpdatedAt !== null
3492
- ? __expectNonNull(__parseRfc3339DateTime(output.UpdatedAt))
3493
- : undefined,
3494
- } as any;
3495
- };
3496
-
3497
- const deserializeAws_restJson1JobError = (output: any, context: __SerdeContext): JobError => {
3498
- return {
3499
- Code: __expectString(output.Code),
3500
- Details:
3501
- output.Details !== undefined && output.Details !== null
3502
- ? deserializeAws_restJson1Details(output.Details, context)
3503
- : undefined,
3504
- LimitName: __expectString(output.LimitName),
3505
- LimitValue: __limitedParseDouble(output.LimitValue),
3506
- Message: __expectString(output.Message),
3507
- ResourceId: __expectString(output.ResourceId),
3508
- ResourceType: __expectString(output.ResourceType),
3509
- } as any;
3510
- };
3511
-
3512
- const deserializeAws_restJson1ListOfAssetDestinationEntry = (
3513
- output: any,
3514
- context: __SerdeContext
3515
- ): AssetDestinationEntry[] => {
3516
- return (output || [])
3517
- .filter((e: any) => e != null)
3518
- .map((entry: any) => {
3519
- if (entry === null) {
3520
- return null as any;
3521
- }
3522
- return deserializeAws_restJson1AssetDestinationEntry(entry, context);
3523
- });
3524
- };
3525
-
3526
- const deserializeAws_restJson1ListOfAssetEntry = (output: any, context: __SerdeContext): AssetEntry[] => {
3527
- return (output || [])
3528
- .filter((e: any) => e != null)
3529
- .map((entry: any) => {
3530
- if (entry === null) {
3531
- return null as any;
3532
- }
3533
- return deserializeAws_restJson1AssetEntry(entry, context);
3534
- });
3535
- };
3536
-
3537
- const deserializeAws_restJson1ListOfAssetSourceEntry = (output: any, context: __SerdeContext): AssetSourceEntry[] => {
3538
- return (output || [])
3539
- .filter((e: any) => e != null)
3540
- .map((entry: any) => {
3541
- if (entry === null) {
3542
- return null as any;
3543
- }
3544
- return deserializeAws_restJson1AssetSourceEntry(entry, context);
3545
- });
3546
- };
3547
-
3548
- const deserializeAws_restJson1ListOfDataSetEntry = (output: any, context: __SerdeContext): DataSetEntry[] => {
3549
- return (output || [])
3550
- .filter((e: any) => e != null)
3551
- .map((entry: any) => {
3552
- if (entry === null) {
3553
- return null as any;
3554
- }
3555
- return deserializeAws_restJson1DataSetEntry(entry, context);
3556
- });
3557
- };
3558
-
3559
- const deserializeAws_restJson1ListOfJobEntry = (output: any, context: __SerdeContext): JobEntry[] => {
3560
- return (output || [])
3561
- .filter((e: any) => e != null)
3562
- .map((entry: any) => {
3563
- if (entry === null) {
3564
- return null as any;
3565
- }
3566
- return deserializeAws_restJson1JobEntry(entry, context);
3567
- });
3568
- };
3569
-
3570
- const deserializeAws_restJson1ListOfJobError = (output: any, context: __SerdeContext): JobError[] => {
3571
- return (output || [])
3572
- .filter((e: any) => e != null)
3573
- .map((entry: any) => {
3574
- if (entry === null) {
3575
- return null as any;
3576
- }
3577
- return deserializeAws_restJson1JobError(entry, context);
3578
- });
3579
- };
3580
-
3581
- const deserializeAws_restJson1ListOfRevisionDestinationEntry = (
3582
- output: any,
3583
- context: __SerdeContext
3584
- ): RevisionDestinationEntry[] => {
3585
- return (output || [])
3586
- .filter((e: any) => e != null)
3587
- .map((entry: any) => {
3588
- if (entry === null) {
3589
- return null as any;
3590
- }
3591
- return deserializeAws_restJson1RevisionDestinationEntry(entry, context);
3592
- });
3593
- };
3594
-
3595
- const deserializeAws_restJson1ListOfRevisionEntry = (output: any, context: __SerdeContext): RevisionEntry[] => {
3596
- return (output || [])
3597
- .filter((e: any) => e != null)
3598
- .map((entry: any) => {
3599
- if (entry === null) {
3600
- return null as any;
3601
- }
3602
- return deserializeAws_restJson1RevisionEntry(entry, context);
3603
- });
3604
- };
3605
-
3606
- const deserializeAws_restJson1MapOf__string = (output: any, context: __SerdeContext): { [key: string]: string } => {
3607
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3608
- if (value === null) {
3609
- return acc;
3610
- }
3611
- return {
3612
- ...acc,
3613
- [key]: __expectString(value) as any,
3614
- };
3615
- }, {});
3616
- };
3617
-
3618
- const deserializeAws_restJson1OriginDetails = (output: any, context: __SerdeContext): OriginDetails => {
3619
- return {
3620
- ProductId: __expectString(output.ProductId),
3621
- } as any;
3622
- };
3623
-
3624
- const deserializeAws_restJson1ResponseDetails = (output: any, context: __SerdeContext): ResponseDetails => {
3625
- return {
3626
- ExportAssetToSignedUrl:
3627
- output.ExportAssetToSignedUrl !== undefined && output.ExportAssetToSignedUrl !== null
3628
- ? deserializeAws_restJson1ExportAssetToSignedUrlResponseDetails(output.ExportAssetToSignedUrl, context)
3629
- : undefined,
3630
- ExportAssetsToS3:
3631
- output.ExportAssetsToS3 !== undefined && output.ExportAssetsToS3 !== null
3632
- ? deserializeAws_restJson1ExportAssetsToS3ResponseDetails(output.ExportAssetsToS3, context)
3633
- : undefined,
3634
- ExportRevisionsToS3:
3635
- output.ExportRevisionsToS3 !== undefined && output.ExportRevisionsToS3 !== null
3636
- ? deserializeAws_restJson1ExportRevisionsToS3ResponseDetails(output.ExportRevisionsToS3, context)
3637
- : undefined,
3638
- ImportAssetFromSignedUrl:
3639
- output.ImportAssetFromSignedUrl !== undefined && output.ImportAssetFromSignedUrl !== null
3640
- ? deserializeAws_restJson1ImportAssetFromSignedUrlResponseDetails(output.ImportAssetFromSignedUrl, context)
3641
- : undefined,
3642
- ImportAssetsFromS3:
3643
- output.ImportAssetsFromS3 !== undefined && output.ImportAssetsFromS3 !== null
3644
- ? deserializeAws_restJson1ImportAssetsFromS3ResponseDetails(output.ImportAssetsFromS3, context)
3645
- : undefined,
3646
- } as any;
3647
- };
3648
-
3649
- const deserializeAws_restJson1RevisionDestinationEntry = (
3650
- output: any,
3651
- context: __SerdeContext
3652
- ): RevisionDestinationEntry => {
3653
- return {
3654
- Bucket: __expectString(output.Bucket),
3655
- KeyPattern: __expectString(output.KeyPattern),
3656
- RevisionId: __expectString(output.RevisionId),
3657
- } as any;
3658
- };
3659
-
3660
- const deserializeAws_restJson1RevisionEntry = (output: any, context: __SerdeContext): RevisionEntry => {
3661
- return {
3662
- Arn: __expectString(output.Arn),
3663
- Comment: __expectString(output.Comment),
3664
- CreatedAt:
3665
- output.CreatedAt !== undefined && output.CreatedAt !== null
3666
- ? __expectNonNull(__parseRfc3339DateTime(output.CreatedAt))
3667
- : undefined,
3668
- DataSetId: __expectString(output.DataSetId),
3669
- Finalized: __expectBoolean(output.Finalized),
3670
- Id: __expectString(output.Id),
3671
- SourceId: __expectString(output.SourceId),
3672
- UpdatedAt:
3673
- output.UpdatedAt !== undefined && output.UpdatedAt !== null
3674
- ? __expectNonNull(__parseRfc3339DateTime(output.UpdatedAt))
3675
- : undefined,
3676
- } as any;
3677
- };
3678
-
3679
- const deserializeAws_restJson1S3SnapshotAsset = (output: any, context: __SerdeContext): S3SnapshotAsset => {
3680
- return {
3681
- Size: __limitedParseDouble(output.Size),
3682
- } as any;
3683
- };
3684
-
3685
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
3686
- httpStatusCode: output.statusCode,
3687
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
3688
- extendedRequestId: output.headers["x-amz-id-2"],
3689
- cfId: output.headers["x-amz-cf-id"],
3690
- });
3691
-
3692
- // Collect low-level response body stream to Uint8Array.
3693
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
3694
- if (streamBody instanceof Uint8Array) {
3695
- return Promise.resolve(streamBody);
3696
- }
3697
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3698
- };
3699
-
3700
- // Encode Uint8Array data into string with utf-8.
3701
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
3702
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
3703
-
3704
- const isSerializableHeaderValue = (value: any): boolean =>
3705
- value !== undefined &&
3706
- value !== null &&
3707
- value !== "" &&
3708
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
3709
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
3710
-
3711
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
3712
- collectBodyString(streamBody, context).then((encoded) => {
3713
- if (encoded.length) {
3714
- return JSON.parse(encoded);
3715
- }
3716
- return {};
3717
- });
3718
-
3719
- /**
3720
- * Load an error code for the aws.rest-json-1.1 protocol.
3721
- */
3722
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
3723
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
3724
-
3725
- const sanitizeErrorCode = (rawValue: string): string => {
3726
- let cleanValue = rawValue;
3727
- if (cleanValue.indexOf(":") >= 0) {
3728
- cleanValue = cleanValue.split(":")[0];
3729
- }
3730
- if (cleanValue.indexOf("#") >= 0) {
3731
- cleanValue = cleanValue.split("#")[1];
3732
- }
3733
- return cleanValue;
3734
- };
3735
-
3736
- const headerKey = findKey(output.headers, "x-amzn-errortype");
3737
- if (headerKey !== undefined) {
3738
- return sanitizeErrorCode(output.headers[headerKey]);
3739
- }
3740
-
3741
- if (data.code !== undefined) {
3742
- return sanitizeErrorCode(data.code);
3743
- }
3744
-
3745
- if (data["__type"] !== undefined) {
3746
- return sanitizeErrorCode(data["__type"]);
3747
- }
3748
-
3749
- return "";
3750
- };