@aws-sdk/client-mgn 3.33.0 → 3.36.1

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 (310) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/{dist/cjs → dist-cjs}/Mgn.js +1 -5
  3. package/{dist/cjs → dist-cjs}/MgnClient.js +8 -17
  4. package/{dist/cjs → dist-cjs}/commands/ChangeServerLifeCycleStateCommand.js +2 -27
  5. package/{dist/cjs → dist-cjs}/commands/CreateReplicationConfigurationTemplateCommand.js +2 -27
  6. package/{dist/cjs → dist-cjs}/commands/DeleteJobCommand.js +2 -27
  7. package/{dist/cjs → dist-cjs}/commands/DeleteReplicationConfigurationTemplateCommand.js +2 -27
  8. package/{dist/cjs → dist-cjs}/commands/DeleteSourceServerCommand.js +2 -27
  9. package/{dist/cjs → dist-cjs}/commands/DescribeJobLogItemsCommand.js +2 -27
  10. package/{dist/cjs → dist-cjs}/commands/DescribeJobsCommand.js +2 -27
  11. package/{dist/cjs → dist-cjs}/commands/DescribeReplicationConfigurationTemplatesCommand.js +2 -27
  12. package/{dist/cjs → dist-cjs}/commands/DescribeSourceServersCommand.js +2 -27
  13. package/dist-cjs/commands/DisconnectFromServiceCommand.js +36 -0
  14. package/dist-cjs/commands/FinalizeCutoverCommand.js +36 -0
  15. package/{dist/cjs → dist-cjs}/commands/GetLaunchConfigurationCommand.js +2 -27
  16. package/{dist/cjs → dist-cjs}/commands/GetReplicationConfigurationCommand.js +2 -27
  17. package/{dist/cjs → dist-cjs}/commands/InitializeServiceCommand.js +2 -27
  18. package/{dist/cjs → dist-cjs}/commands/ListTagsForResourceCommand.js +2 -27
  19. package/{dist/cjs → dist-cjs}/commands/MarkAsArchivedCommand.js +2 -27
  20. package/{dist/cjs → dist-cjs}/commands/RetryDataReplicationCommand.js +2 -27
  21. package/{dist/cjs → dist-cjs}/commands/StartCutoverCommand.js +2 -27
  22. package/{dist/cjs → dist-cjs}/commands/StartTestCommand.js +2 -27
  23. package/{dist/cjs → dist-cjs}/commands/TagResourceCommand.js +2 -27
  24. package/{dist/cjs → dist-cjs}/commands/TerminateTargetInstancesCommand.js +2 -27
  25. package/{dist/cjs → dist-cjs}/commands/UntagResourceCommand.js +2 -27
  26. package/{dist/cjs → dist-cjs}/commands/UpdateLaunchConfigurationCommand.js +2 -27
  27. package/{dist/cjs → dist-cjs}/commands/UpdateReplicationConfigurationCommand.js +2 -27
  28. package/{dist/cjs → dist-cjs}/commands/UpdateReplicationConfigurationTemplateCommand.js +2 -27
  29. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  30. package/{dist/cjs → dist-cjs}/index.js +0 -1
  31. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  32. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -238
  33. package/{dist/cjs → dist-cjs}/pagination/DescribeJobLogItemsPaginator.js +1 -12
  34. package/{dist/cjs → dist-cjs}/pagination/DescribeJobsPaginator.js +1 -12
  35. package/{dist/cjs → dist-cjs}/pagination/DescribeReplicationConfigurationTemplatesPaginator.js +1 -12
  36. package/{dist/cjs → dist-cjs}/pagination/DescribeSourceServersPaginator.js +1 -12
  37. package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
  38. package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +22 -28
  39. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
  40. package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
  41. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
  42. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
  43. package/{dist/es → dist-es}/Mgn.js +2 -6
  44. package/{dist/es → dist-es}/MgnClient.js +2 -11
  45. package/{dist/es → dist-es}/commands/ChangeServerLifeCycleStateCommand.js +4 -30
  46. package/{dist/es → dist-es}/commands/CreateReplicationConfigurationTemplateCommand.js +4 -30
  47. package/{dist/es → dist-es}/commands/DeleteJobCommand.js +4 -30
  48. package/{dist/es → dist-es}/commands/DeleteReplicationConfigurationTemplateCommand.js +4 -30
  49. package/{dist/es → dist-es}/commands/DeleteSourceServerCommand.js +4 -30
  50. package/{dist/es → dist-es}/commands/DescribeJobLogItemsCommand.js +4 -30
  51. package/{dist/es → dist-es}/commands/DescribeJobsCommand.js +4 -30
  52. package/{dist/es → dist-es}/commands/DescribeReplicationConfigurationTemplatesCommand.js +4 -30
  53. package/{dist/es → dist-es}/commands/DescribeSourceServersCommand.js +4 -30
  54. package/dist-es/commands/DisconnectFromServiceCommand.js +39 -0
  55. package/{dist/es → dist-es}/commands/FinalizeCutoverCommand.js +4 -30
  56. package/{dist/es → dist-es}/commands/GetLaunchConfigurationCommand.js +4 -30
  57. package/{dist/es → dist-es}/commands/GetReplicationConfigurationCommand.js +4 -30
  58. package/{dist/es → dist-es}/commands/InitializeServiceCommand.js +4 -30
  59. package/{dist/es → dist-es}/commands/ListTagsForResourceCommand.js +4 -30
  60. package/{dist/es → dist-es}/commands/MarkAsArchivedCommand.js +4 -30
  61. package/{dist/es → dist-es}/commands/RetryDataReplicationCommand.js +4 -30
  62. package/{dist/es → dist-es}/commands/StartCutoverCommand.js +4 -30
  63. package/{dist/es → dist-es}/commands/StartTestCommand.js +4 -30
  64. package/{dist/es → dist-es}/commands/TagResourceCommand.js +4 -30
  65. package/{dist/es → dist-es}/commands/TerminateTargetInstancesCommand.js +4 -30
  66. package/{dist/es → dist-es}/commands/UntagResourceCommand.js +4 -30
  67. package/{dist/es → dist-es}/commands/UpdateLaunchConfigurationCommand.js +4 -30
  68. package/{dist/es → dist-es}/commands/UpdateReplicationConfigurationCommand.js +4 -30
  69. package/{dist/es → dist-es}/commands/UpdateReplicationConfigurationTemplateCommand.js +4 -30
  70. package/{dist/es → dist-es}/endpoints.js +1 -2
  71. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  72. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  73. package/{dist/es → dist-es}/models/models_0.js +0 -238
  74. package/{dist/es → dist-es}/pagination/DescribeJobLogItemsPaginator.js +17 -30
  75. package/{dist/es → dist-es}/pagination/DescribeJobsPaginator.js +17 -30
  76. package/{dist/es → dist-es}/pagination/DescribeReplicationConfigurationTemplatesPaginator.js +17 -30
  77. package/{dist/es → dist-es}/pagination/DescribeSourceServersPaginator.js +17 -30
  78. package/dist-es/pagination/Interfaces.js +1 -0
  79. package/{dist/es → dist-es}/protocols/Aws_restJson1.js +550 -556
  80. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  81. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  82. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  83. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  84. package/{dist/types → dist-types}/Mgn.d.ts +2 -2
  85. package/{dist/types → dist-types}/MgnClient.d.ts +8 -8
  86. package/{dist/types → dist-types}/commands/ChangeServerLifeCycleStateCommand.d.ts +2 -2
  87. package/{dist/types → dist-types}/commands/CreateReplicationConfigurationTemplateCommand.d.ts +2 -2
  88. package/{dist/types → dist-types}/commands/DeleteJobCommand.d.ts +2 -2
  89. package/{dist/types → dist-types}/commands/DeleteReplicationConfigurationTemplateCommand.d.ts +2 -2
  90. package/{dist/types → dist-types}/commands/DeleteSourceServerCommand.d.ts +2 -2
  91. package/{dist/types → dist-types}/commands/DescribeJobLogItemsCommand.d.ts +2 -2
  92. package/{dist/types → dist-types}/commands/DescribeJobsCommand.d.ts +2 -2
  93. package/{dist/types → dist-types}/commands/DescribeReplicationConfigurationTemplatesCommand.d.ts +2 -2
  94. package/{dist/types → dist-types}/commands/DescribeSourceServersCommand.d.ts +2 -2
  95. package/{dist/types → dist-types}/commands/DisconnectFromServiceCommand.d.ts +2 -2
  96. package/{dist/types → dist-types}/commands/FinalizeCutoverCommand.d.ts +2 -2
  97. package/{dist/types → dist-types}/commands/GetLaunchConfigurationCommand.d.ts +2 -2
  98. package/{dist/types → dist-types}/commands/GetReplicationConfigurationCommand.d.ts +2 -2
  99. package/{dist/types → dist-types}/commands/InitializeServiceCommand.d.ts +2 -2
  100. package/{dist/types → dist-types}/commands/ListTagsForResourceCommand.d.ts +2 -2
  101. package/{dist/types → dist-types}/commands/MarkAsArchivedCommand.d.ts +2 -2
  102. package/{dist/types → dist-types}/commands/RetryDataReplicationCommand.d.ts +2 -2
  103. package/{dist/types → dist-types}/commands/StartCutoverCommand.d.ts +2 -2
  104. package/{dist/types → dist-types}/commands/StartTestCommand.d.ts +2 -2
  105. package/{dist/types → dist-types}/commands/TagResourceCommand.d.ts +2 -2
  106. package/{dist/types → dist-types}/commands/TerminateTargetInstancesCommand.d.ts +2 -2
  107. package/{dist/types → dist-types}/commands/UntagResourceCommand.d.ts +2 -2
  108. package/{dist/types → dist-types}/commands/UpdateLaunchConfigurationCommand.d.ts +2 -2
  109. package/{dist/types → dist-types}/commands/UpdateReplicationConfigurationCommand.d.ts +2 -2
  110. package/{dist/types → dist-types}/commands/UpdateReplicationConfigurationTemplateCommand.d.ts +2 -2
  111. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  112. package/{index.ts → dist-types/index.d.ts} +0 -0
  113. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  114. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  115. package/{dist/types → dist-types}/pagination/DescribeJobLogItemsPaginator.d.ts +1 -1
  116. package/{dist/types → dist-types}/pagination/DescribeJobsPaginator.d.ts +1 -1
  117. package/{dist/types → dist-types}/pagination/DescribeReplicationConfigurationTemplatesPaginator.d.ts +1 -1
  118. package/{dist/types → dist-types}/pagination/DescribeSourceServersPaginator.d.ts +1 -1
  119. package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
  120. package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
  121. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
  122. package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
  123. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
  124. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  125. package/{dist/types → dist-types}/ts3.4/Mgn.d.ts +28 -80
  126. package/{dist/types → dist-types}/ts3.4/MgnClient.d.ts +32 -97
  127. package/dist-types/ts3.4/commands/ChangeServerLifeCycleStateCommand.d.ts +17 -0
  128. package/{dist/types → dist-types}/ts3.4/commands/CreateReplicationConfigurationTemplateCommand.d.ts +4 -22
  129. package/dist-types/ts3.4/commands/DeleteJobCommand.d.ts +17 -0
  130. package/{dist/types → dist-types}/ts3.4/commands/DeleteReplicationConfigurationTemplateCommand.d.ts +4 -22
  131. package/{dist/types → dist-types}/ts3.4/commands/DeleteSourceServerCommand.d.ts +4 -22
  132. package/{dist/types → dist-types}/ts3.4/commands/DescribeJobLogItemsCommand.d.ts +4 -22
  133. package/dist-types/ts3.4/commands/DescribeJobsCommand.d.ts +17 -0
  134. package/{dist/types → dist-types}/ts3.4/commands/DescribeReplicationConfigurationTemplatesCommand.d.ts +4 -22
  135. package/{dist/types → dist-types}/ts3.4/commands/DescribeSourceServersCommand.d.ts +4 -22
  136. package/dist-types/ts3.4/commands/DisconnectFromServiceCommand.d.ts +17 -0
  137. package/dist-types/ts3.4/commands/FinalizeCutoverCommand.d.ts +17 -0
  138. package/{dist/types → dist-types}/ts3.4/commands/GetLaunchConfigurationCommand.d.ts +4 -22
  139. package/{dist/types → dist-types}/ts3.4/commands/GetReplicationConfigurationCommand.d.ts +4 -22
  140. package/{dist/types → dist-types}/ts3.4/commands/InitializeServiceCommand.d.ts +4 -22
  141. package/{dist/types → dist-types}/ts3.4/commands/ListTagsForResourceCommand.d.ts +4 -22
  142. package/dist-types/ts3.4/commands/MarkAsArchivedCommand.d.ts +17 -0
  143. package/dist-types/ts3.4/commands/RetryDataReplicationCommand.d.ts +17 -0
  144. package/dist-types/ts3.4/commands/StartCutoverCommand.d.ts +17 -0
  145. package/dist-types/ts3.4/commands/StartTestCommand.d.ts +17 -0
  146. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  147. package/dist-types/ts3.4/commands/TerminateTargetInstancesCommand.d.ts +17 -0
  148. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  149. package/{dist/types → dist-types}/ts3.4/commands/UpdateLaunchConfigurationCommand.d.ts +4 -22
  150. package/{dist/types → dist-types}/ts3.4/commands/UpdateReplicationConfigurationCommand.d.ts +4 -22
  151. package/{dist/types → dist-types}/ts3.4/commands/UpdateReplicationConfigurationTemplateCommand.d.ts +4 -22
  152. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  153. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  154. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  155. package/{dist/types → dist-types}/ts3.4/models/models_0.d.ts +361 -1083
  156. package/{dist/types → dist-types}/ts3.4/pagination/DescribeJobLogItemsPaginator.d.ts +1 -1
  157. package/{dist/types → dist-types}/ts3.4/pagination/DescribeJobsPaginator.d.ts +1 -1
  158. package/{dist/types → dist-types}/ts3.4/pagination/DescribeReplicationConfigurationTemplatesPaginator.d.ts +1 -1
  159. package/{dist/types → dist-types}/ts3.4/pagination/DescribeSourceServersPaginator.d.ts +1 -1
  160. package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
  161. package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
  162. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
  163. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
  164. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
  165. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
  166. package/package.json +52 -49
  167. package/Mgn.ts +0 -904
  168. package/MgnClient.ts +0 -355
  169. package/commands/ChangeServerLifeCycleStateCommand.ts +0 -97
  170. package/commands/CreateReplicationConfigurationTemplateCommand.ts +0 -103
  171. package/commands/DeleteJobCommand.ts +0 -90
  172. package/commands/DeleteReplicationConfigurationTemplateCommand.ts +0 -106
  173. package/commands/DeleteSourceServerCommand.ts +0 -94
  174. package/commands/DescribeJobLogItemsCommand.ts +0 -94
  175. package/commands/DescribeJobsCommand.ts +0 -94
  176. package/commands/DescribeReplicationConfigurationTemplatesCommand.ts +0 -109
  177. package/commands/DescribeSourceServersCommand.ts +0 -94
  178. package/commands/DisconnectFromServiceCommand.ts +0 -94
  179. package/commands/FinalizeCutoverCommand.ts +0 -94
  180. package/commands/GetLaunchConfigurationCommand.ts +0 -94
  181. package/commands/GetReplicationConfigurationCommand.ts +0 -97
  182. package/commands/InitializeServiceCommand.ts +0 -94
  183. package/commands/ListTagsForResourceCommand.ts +0 -94
  184. package/commands/MarkAsArchivedCommand.ts +0 -94
  185. package/commands/RetryDataReplicationCommand.ts +0 -94
  186. package/commands/StartCutoverCommand.ts +0 -94
  187. package/commands/StartTestCommand.ts +0 -90
  188. package/commands/TagResourceCommand.ts +0 -94
  189. package/commands/TerminateTargetInstancesCommand.ts +0 -94
  190. package/commands/UntagResourceCommand.ts +0 -94
  191. package/commands/UpdateLaunchConfigurationCommand.ts +0 -97
  192. package/commands/UpdateReplicationConfigurationCommand.ts +0 -100
  193. package/commands/UpdateReplicationConfigurationTemplateCommand.ts +0 -103
  194. package/dist/cjs/Mgn.js.map +0 -1
  195. package/dist/cjs/MgnClient.js.map +0 -1
  196. package/dist/cjs/commands/ChangeServerLifeCycleStateCommand.js.map +0 -1
  197. package/dist/cjs/commands/CreateReplicationConfigurationTemplateCommand.js.map +0 -1
  198. package/dist/cjs/commands/DeleteJobCommand.js.map +0 -1
  199. package/dist/cjs/commands/DeleteReplicationConfigurationTemplateCommand.js.map +0 -1
  200. package/dist/cjs/commands/DeleteSourceServerCommand.js.map +0 -1
  201. package/dist/cjs/commands/DescribeJobLogItemsCommand.js.map +0 -1
  202. package/dist/cjs/commands/DescribeJobsCommand.js.map +0 -1
  203. package/dist/cjs/commands/DescribeReplicationConfigurationTemplatesCommand.js.map +0 -1
  204. package/dist/cjs/commands/DescribeSourceServersCommand.js.map +0 -1
  205. package/dist/cjs/commands/DisconnectFromServiceCommand.js +0 -61
  206. package/dist/cjs/commands/DisconnectFromServiceCommand.js.map +0 -1
  207. package/dist/cjs/commands/FinalizeCutoverCommand.js +0 -61
  208. package/dist/cjs/commands/FinalizeCutoverCommand.js.map +0 -1
  209. package/dist/cjs/commands/GetLaunchConfigurationCommand.js.map +0 -1
  210. package/dist/cjs/commands/GetReplicationConfigurationCommand.js.map +0 -1
  211. package/dist/cjs/commands/InitializeServiceCommand.js.map +0 -1
  212. package/dist/cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  213. package/dist/cjs/commands/MarkAsArchivedCommand.js.map +0 -1
  214. package/dist/cjs/commands/RetryDataReplicationCommand.js.map +0 -1
  215. package/dist/cjs/commands/StartCutoverCommand.js.map +0 -1
  216. package/dist/cjs/commands/StartTestCommand.js.map +0 -1
  217. package/dist/cjs/commands/TagResourceCommand.js.map +0 -1
  218. package/dist/cjs/commands/TerminateTargetInstancesCommand.js.map +0 -1
  219. package/dist/cjs/commands/UntagResourceCommand.js.map +0 -1
  220. package/dist/cjs/commands/UpdateLaunchConfigurationCommand.js.map +0 -1
  221. package/dist/cjs/commands/UpdateReplicationConfigurationCommand.js.map +0 -1
  222. package/dist/cjs/commands/UpdateReplicationConfigurationTemplateCommand.js.map +0 -1
  223. package/dist/cjs/endpoints.js.map +0 -1
  224. package/dist/cjs/index.js.map +0 -1
  225. package/dist/cjs/models/index.js.map +0 -1
  226. package/dist/cjs/models/models_0.js.map +0 -1
  227. package/dist/cjs/package.json +0 -91
  228. package/dist/cjs/pagination/DescribeJobLogItemsPaginator.js.map +0 -1
  229. package/dist/cjs/pagination/DescribeJobsPaginator.js.map +0 -1
  230. package/dist/cjs/pagination/DescribeReplicationConfigurationTemplatesPaginator.js.map +0 -1
  231. package/dist/cjs/pagination/DescribeSourceServersPaginator.js.map +0 -1
  232. package/dist/cjs/pagination/Interfaces.js.map +0 -1
  233. package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
  234. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  235. package/dist/cjs/runtimeConfig.js.map +0 -1
  236. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  237. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  238. package/dist/es/Mgn.js.map +0 -1
  239. package/dist/es/MgnClient.js.map +0 -1
  240. package/dist/es/commands/ChangeServerLifeCycleStateCommand.js.map +0 -1
  241. package/dist/es/commands/CreateReplicationConfigurationTemplateCommand.js.map +0 -1
  242. package/dist/es/commands/DeleteJobCommand.js.map +0 -1
  243. package/dist/es/commands/DeleteReplicationConfigurationTemplateCommand.js.map +0 -1
  244. package/dist/es/commands/DeleteSourceServerCommand.js.map +0 -1
  245. package/dist/es/commands/DescribeJobLogItemsCommand.js.map +0 -1
  246. package/dist/es/commands/DescribeJobsCommand.js.map +0 -1
  247. package/dist/es/commands/DescribeReplicationConfigurationTemplatesCommand.js.map +0 -1
  248. package/dist/es/commands/DescribeSourceServersCommand.js.map +0 -1
  249. package/dist/es/commands/DisconnectFromServiceCommand.js +0 -65
  250. package/dist/es/commands/DisconnectFromServiceCommand.js.map +0 -1
  251. package/dist/es/commands/FinalizeCutoverCommand.js.map +0 -1
  252. package/dist/es/commands/GetLaunchConfigurationCommand.js.map +0 -1
  253. package/dist/es/commands/GetReplicationConfigurationCommand.js.map +0 -1
  254. package/dist/es/commands/InitializeServiceCommand.js.map +0 -1
  255. package/dist/es/commands/ListTagsForResourceCommand.js.map +0 -1
  256. package/dist/es/commands/MarkAsArchivedCommand.js.map +0 -1
  257. package/dist/es/commands/RetryDataReplicationCommand.js.map +0 -1
  258. package/dist/es/commands/StartCutoverCommand.js.map +0 -1
  259. package/dist/es/commands/StartTestCommand.js.map +0 -1
  260. package/dist/es/commands/TagResourceCommand.js.map +0 -1
  261. package/dist/es/commands/TerminateTargetInstancesCommand.js.map +0 -1
  262. package/dist/es/commands/UntagResourceCommand.js.map +0 -1
  263. package/dist/es/commands/UpdateLaunchConfigurationCommand.js.map +0 -1
  264. package/dist/es/commands/UpdateReplicationConfigurationCommand.js.map +0 -1
  265. package/dist/es/commands/UpdateReplicationConfigurationTemplateCommand.js.map +0 -1
  266. package/dist/es/endpoints.js.map +0 -1
  267. package/dist/es/index.js +0 -34
  268. package/dist/es/index.js.map +0 -1
  269. package/dist/es/models/index.js +0 -2
  270. package/dist/es/models/index.js.map +0 -1
  271. package/dist/es/models/models_0.js.map +0 -1
  272. package/dist/es/package.json +0 -91
  273. package/dist/es/pagination/DescribeJobLogItemsPaginator.js.map +0 -1
  274. package/dist/es/pagination/DescribeJobsPaginator.js.map +0 -1
  275. package/dist/es/pagination/DescribeReplicationConfigurationTemplatesPaginator.js.map +0 -1
  276. package/dist/es/pagination/DescribeSourceServersPaginator.js.map +0 -1
  277. package/dist/es/pagination/Interfaces.js +0 -2
  278. package/dist/es/pagination/Interfaces.js.map +0 -1
  279. package/dist/es/protocols/Aws_restJson1.js.map +0 -1
  280. package/dist/es/runtimeConfig.browser.js.map +0 -1
  281. package/dist/es/runtimeConfig.js.map +0 -1
  282. package/dist/es/runtimeConfig.native.js.map +0 -1
  283. package/dist/es/runtimeConfig.shared.js.map +0 -1
  284. package/dist/types/ts3.4/commands/ChangeServerLifeCycleStateCommand.d.ts +0 -35
  285. package/dist/types/ts3.4/commands/DeleteJobCommand.d.ts +0 -35
  286. package/dist/types/ts3.4/commands/DescribeJobsCommand.d.ts +0 -35
  287. package/dist/types/ts3.4/commands/DisconnectFromServiceCommand.d.ts +0 -35
  288. package/dist/types/ts3.4/commands/FinalizeCutoverCommand.d.ts +0 -35
  289. package/dist/types/ts3.4/commands/MarkAsArchivedCommand.d.ts +0 -35
  290. package/dist/types/ts3.4/commands/RetryDataReplicationCommand.d.ts +0 -35
  291. package/dist/types/ts3.4/commands/StartCutoverCommand.d.ts +0 -35
  292. package/dist/types/ts3.4/commands/StartTestCommand.d.ts +0 -35
  293. package/dist/types/ts3.4/commands/TagResourceCommand.d.ts +0 -35
  294. package/dist/types/ts3.4/commands/TerminateTargetInstancesCommand.d.ts +0 -35
  295. package/dist/types/ts3.4/commands/UntagResourceCommand.d.ts +0 -35
  296. package/endpoints.ts +0 -57
  297. package/jest.config.js +0 -4
  298. package/models/models_0.ts +0 -2416
  299. package/pagination/DescribeJobLogItemsPaginator.ts +0 -58
  300. package/pagination/DescribeJobsPaginator.ts +0 -58
  301. package/pagination/DescribeReplicationConfigurationTemplatesPaginator.ts +0 -58
  302. package/pagination/DescribeSourceServersPaginator.ts +0 -58
  303. package/pagination/Interfaces.ts +0 -7
  304. package/protocols/Aws_restJson1.ts +0 -4171
  305. package/runtimeConfig.browser.ts +0 -40
  306. package/runtimeConfig.native.ts +0 -16
  307. package/runtimeConfig.shared.ts +0 -16
  308. package/runtimeConfig.ts +0 -45
  309. package/tsconfig.es.json +0 -12
  310. package/tsconfig.json +0 -32
@@ -1,4171 +0,0 @@
1
- import {
2
- ChangeServerLifeCycleStateCommandInput,
3
- ChangeServerLifeCycleStateCommandOutput,
4
- } from "../commands/ChangeServerLifeCycleStateCommand";
5
- import {
6
- CreateReplicationConfigurationTemplateCommandInput,
7
- CreateReplicationConfigurationTemplateCommandOutput,
8
- } from "../commands/CreateReplicationConfigurationTemplateCommand";
9
- import { DeleteJobCommandInput, DeleteJobCommandOutput } from "../commands/DeleteJobCommand";
10
- import {
11
- DeleteReplicationConfigurationTemplateCommandInput,
12
- DeleteReplicationConfigurationTemplateCommandOutput,
13
- } from "../commands/DeleteReplicationConfigurationTemplateCommand";
14
- import { DeleteSourceServerCommandInput, DeleteSourceServerCommandOutput } from "../commands/DeleteSourceServerCommand";
15
- import {
16
- DescribeJobLogItemsCommandInput,
17
- DescribeJobLogItemsCommandOutput,
18
- } from "../commands/DescribeJobLogItemsCommand";
19
- import { DescribeJobsCommandInput, DescribeJobsCommandOutput } from "../commands/DescribeJobsCommand";
20
- import {
21
- DescribeReplicationConfigurationTemplatesCommandInput,
22
- DescribeReplicationConfigurationTemplatesCommandOutput,
23
- } from "../commands/DescribeReplicationConfigurationTemplatesCommand";
24
- import {
25
- DescribeSourceServersCommandInput,
26
- DescribeSourceServersCommandOutput,
27
- } from "../commands/DescribeSourceServersCommand";
28
- import {
29
- DisconnectFromServiceCommandInput,
30
- DisconnectFromServiceCommandOutput,
31
- } from "../commands/DisconnectFromServiceCommand";
32
- import { FinalizeCutoverCommandInput, FinalizeCutoverCommandOutput } from "../commands/FinalizeCutoverCommand";
33
- import {
34
- GetLaunchConfigurationCommandInput,
35
- GetLaunchConfigurationCommandOutput,
36
- } from "../commands/GetLaunchConfigurationCommand";
37
- import {
38
- GetReplicationConfigurationCommandInput,
39
- GetReplicationConfigurationCommandOutput,
40
- } from "../commands/GetReplicationConfigurationCommand";
41
- import { InitializeServiceCommandInput, InitializeServiceCommandOutput } from "../commands/InitializeServiceCommand";
42
- import {
43
- ListTagsForResourceCommandInput,
44
- ListTagsForResourceCommandOutput,
45
- } from "../commands/ListTagsForResourceCommand";
46
- import { MarkAsArchivedCommandInput, MarkAsArchivedCommandOutput } from "../commands/MarkAsArchivedCommand";
47
- import {
48
- RetryDataReplicationCommandInput,
49
- RetryDataReplicationCommandOutput,
50
- } from "../commands/RetryDataReplicationCommand";
51
- import { StartCutoverCommandInput, StartCutoverCommandOutput } from "../commands/StartCutoverCommand";
52
- import { StartTestCommandInput, StartTestCommandOutput } from "../commands/StartTestCommand";
53
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
54
- import {
55
- TerminateTargetInstancesCommandInput,
56
- TerminateTargetInstancesCommandOutput,
57
- } from "../commands/TerminateTargetInstancesCommand";
58
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
59
- import {
60
- UpdateLaunchConfigurationCommandInput,
61
- UpdateLaunchConfigurationCommandOutput,
62
- } from "../commands/UpdateLaunchConfigurationCommand";
63
- import {
64
- UpdateReplicationConfigurationCommandInput,
65
- UpdateReplicationConfigurationCommandOutput,
66
- } from "../commands/UpdateReplicationConfigurationCommand";
67
- import {
68
- UpdateReplicationConfigurationTemplateCommandInput,
69
- UpdateReplicationConfigurationTemplateCommandOutput,
70
- } from "../commands/UpdateReplicationConfigurationTemplateCommand";
71
- import {
72
- AccessDeniedException,
73
- CPU,
74
- ChangeServerLifeCycleStateSourceServerLifecycle,
75
- ConflictException,
76
- DataReplicationError,
77
- DataReplicationInfo,
78
- DataReplicationInfoReplicatedDisk,
79
- DataReplicationInitiation,
80
- DataReplicationInitiationStep,
81
- DescribeJobsRequestFilters,
82
- DescribeSourceServersRequestFilters,
83
- Disk,
84
- IdentificationHints,
85
- InternalServerException,
86
- Job,
87
- JobLog,
88
- JobLogEventData,
89
- LaunchedInstance,
90
- Licensing,
91
- LifeCycle,
92
- LifeCycleLastCutover,
93
- LifeCycleLastCutoverFinalized,
94
- LifeCycleLastCutoverInitiated,
95
- LifeCycleLastCutoverReverted,
96
- LifeCycleLastTest,
97
- LifeCycleLastTestFinalized,
98
- LifeCycleLastTestInitiated,
99
- LifeCycleLastTestReverted,
100
- NetworkInterface,
101
- OS,
102
- ParticipatingServer,
103
- ReplicationConfigurationReplicatedDisk,
104
- ReplicationConfigurationTemplate,
105
- ResourceNotFoundException,
106
- SourceProperties,
107
- SourceServer,
108
- ThrottlingException,
109
- UninitializedAccountException,
110
- ValidationException,
111
- ValidationExceptionField,
112
- } from "../models/models_0";
113
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
114
- import {
115
- expectBoolean as __expectBoolean,
116
- expectLong as __expectLong,
117
- expectNonNull as __expectNonNull,
118
- expectObject as __expectObject,
119
- expectString as __expectString,
120
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
121
- strictParseLong as __strictParseLong,
122
- } from "@aws-sdk/smithy-client";
123
- import {
124
- Endpoint as __Endpoint,
125
- MetadataBearer as __MetadataBearer,
126
- ResponseMetadata as __ResponseMetadata,
127
- SerdeContext as __SerdeContext,
128
- SmithyException as __SmithyException,
129
- } from "@aws-sdk/types";
130
-
131
- export const serializeAws_restJson1ChangeServerLifeCycleStateCommand = async (
132
- input: ChangeServerLifeCycleStateCommandInput,
133
- context: __SerdeContext
134
- ): Promise<__HttpRequest> => {
135
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
136
- const headers: any = {
137
- "content-type": "application/json",
138
- };
139
- let resolvedPath =
140
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ChangeServerLifeCycleState";
141
- let body: any;
142
- body = JSON.stringify({
143
- ...(input.lifeCycle !== undefined &&
144
- input.lifeCycle !== null && {
145
- lifeCycle: serializeAws_restJson1ChangeServerLifeCycleStateSourceServerLifecycle(input.lifeCycle, context),
146
- }),
147
- ...(input.sourceServerID !== undefined &&
148
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
149
- });
150
- return new __HttpRequest({
151
- protocol,
152
- hostname,
153
- port,
154
- method: "POST",
155
- headers,
156
- path: resolvedPath,
157
- body,
158
- });
159
- };
160
-
161
- export const serializeAws_restJson1CreateReplicationConfigurationTemplateCommand = async (
162
- input: CreateReplicationConfigurationTemplateCommandInput,
163
- context: __SerdeContext
164
- ): Promise<__HttpRequest> => {
165
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
166
- const headers: any = {
167
- "content-type": "application/json",
168
- };
169
- let resolvedPath =
170
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateReplicationConfigurationTemplate";
171
- let body: any;
172
- body = JSON.stringify({
173
- ...(input.associateDefaultSecurityGroup !== undefined &&
174
- input.associateDefaultSecurityGroup !== null && {
175
- associateDefaultSecurityGroup: input.associateDefaultSecurityGroup,
176
- }),
177
- ...(input.bandwidthThrottling !== undefined &&
178
- input.bandwidthThrottling !== null && { bandwidthThrottling: input.bandwidthThrottling }),
179
- ...(input.createPublicIP !== undefined &&
180
- input.createPublicIP !== null && { createPublicIP: input.createPublicIP }),
181
- ...(input.dataPlaneRouting !== undefined &&
182
- input.dataPlaneRouting !== null && { dataPlaneRouting: input.dataPlaneRouting }),
183
- ...(input.defaultLargeStagingDiskType !== undefined &&
184
- input.defaultLargeStagingDiskType !== null && { defaultLargeStagingDiskType: input.defaultLargeStagingDiskType }),
185
- ...(input.ebsEncryption !== undefined && input.ebsEncryption !== null && { ebsEncryption: input.ebsEncryption }),
186
- ...(input.ebsEncryptionKeyArn !== undefined &&
187
- input.ebsEncryptionKeyArn !== null && { ebsEncryptionKeyArn: input.ebsEncryptionKeyArn }),
188
- ...(input.replicationServerInstanceType !== undefined &&
189
- input.replicationServerInstanceType !== null && {
190
- replicationServerInstanceType: input.replicationServerInstanceType,
191
- }),
192
- ...(input.replicationServersSecurityGroupsIDs !== undefined &&
193
- input.replicationServersSecurityGroupsIDs !== null && {
194
- replicationServersSecurityGroupsIDs: serializeAws_restJson1ReplicationServersSecurityGroupsIDs(
195
- input.replicationServersSecurityGroupsIDs,
196
- context
197
- ),
198
- }),
199
- ...(input.stagingAreaSubnetId !== undefined &&
200
- input.stagingAreaSubnetId !== null && { stagingAreaSubnetId: input.stagingAreaSubnetId }),
201
- ...(input.stagingAreaTags !== undefined &&
202
- input.stagingAreaTags !== null && {
203
- stagingAreaTags: serializeAws_restJson1TagsMap(input.stagingAreaTags, context),
204
- }),
205
- ...(input.tags !== undefined &&
206
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
207
- ...(input.useDedicatedReplicationServer !== undefined &&
208
- input.useDedicatedReplicationServer !== null && {
209
- useDedicatedReplicationServer: input.useDedicatedReplicationServer,
210
- }),
211
- });
212
- return new __HttpRequest({
213
- protocol,
214
- hostname,
215
- port,
216
- method: "POST",
217
- headers,
218
- path: resolvedPath,
219
- body,
220
- });
221
- };
222
-
223
- export const serializeAws_restJson1DeleteJobCommand = async (
224
- input: DeleteJobCommandInput,
225
- context: __SerdeContext
226
- ): Promise<__HttpRequest> => {
227
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
228
- const headers: any = {
229
- "content-type": "application/json",
230
- };
231
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteJob";
232
- let body: any;
233
- body = JSON.stringify({
234
- ...(input.jobID !== undefined && input.jobID !== null && { jobID: input.jobID }),
235
- });
236
- return new __HttpRequest({
237
- protocol,
238
- hostname,
239
- port,
240
- method: "POST",
241
- headers,
242
- path: resolvedPath,
243
- body,
244
- });
245
- };
246
-
247
- export const serializeAws_restJson1DeleteReplicationConfigurationTemplateCommand = async (
248
- input: DeleteReplicationConfigurationTemplateCommandInput,
249
- context: __SerdeContext
250
- ): Promise<__HttpRequest> => {
251
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
252
- const headers: any = {
253
- "content-type": "application/json",
254
- };
255
- let resolvedPath =
256
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteReplicationConfigurationTemplate";
257
- let body: any;
258
- body = JSON.stringify({
259
- ...(input.replicationConfigurationTemplateID !== undefined &&
260
- input.replicationConfigurationTemplateID !== null && {
261
- replicationConfigurationTemplateID: input.replicationConfigurationTemplateID,
262
- }),
263
- });
264
- return new __HttpRequest({
265
- protocol,
266
- hostname,
267
- port,
268
- method: "POST",
269
- headers,
270
- path: resolvedPath,
271
- body,
272
- });
273
- };
274
-
275
- export const serializeAws_restJson1DeleteSourceServerCommand = async (
276
- input: DeleteSourceServerCommandInput,
277
- context: __SerdeContext
278
- ): Promise<__HttpRequest> => {
279
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
280
- const headers: any = {
281
- "content-type": "application/json",
282
- };
283
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteSourceServer";
284
- let body: any;
285
- body = JSON.stringify({
286
- ...(input.sourceServerID !== undefined &&
287
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
288
- });
289
- return new __HttpRequest({
290
- protocol,
291
- hostname,
292
- port,
293
- method: "POST",
294
- headers,
295
- path: resolvedPath,
296
- body,
297
- });
298
- };
299
-
300
- export const serializeAws_restJson1DescribeJobLogItemsCommand = async (
301
- input: DescribeJobLogItemsCommandInput,
302
- context: __SerdeContext
303
- ): Promise<__HttpRequest> => {
304
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
305
- const headers: any = {
306
- "content-type": "application/json",
307
- };
308
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeJobLogItems";
309
- let body: any;
310
- body = JSON.stringify({
311
- ...(input.jobID !== undefined && input.jobID !== null && { jobID: input.jobID }),
312
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
313
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
314
- });
315
- return new __HttpRequest({
316
- protocol,
317
- hostname,
318
- port,
319
- method: "POST",
320
- headers,
321
- path: resolvedPath,
322
- body,
323
- });
324
- };
325
-
326
- export const serializeAws_restJson1DescribeJobsCommand = async (
327
- input: DescribeJobsCommandInput,
328
- context: __SerdeContext
329
- ): Promise<__HttpRequest> => {
330
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
331
- const headers: any = {
332
- "content-type": "application/json",
333
- };
334
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeJobs";
335
- let body: any;
336
- body = JSON.stringify({
337
- ...(input.filters !== undefined &&
338
- input.filters !== null && { filters: serializeAws_restJson1DescribeJobsRequestFilters(input.filters, context) }),
339
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
340
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
341
- });
342
- return new __HttpRequest({
343
- protocol,
344
- hostname,
345
- port,
346
- method: "POST",
347
- headers,
348
- path: resolvedPath,
349
- body,
350
- });
351
- };
352
-
353
- export const serializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand = async (
354
- input: DescribeReplicationConfigurationTemplatesCommandInput,
355
- context: __SerdeContext
356
- ): Promise<__HttpRequest> => {
357
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
358
- const headers: any = {
359
- "content-type": "application/json",
360
- };
361
- let resolvedPath =
362
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
363
- "/DescribeReplicationConfigurationTemplates";
364
- let body: any;
365
- body = JSON.stringify({
366
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
367
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
368
- ...(input.replicationConfigurationTemplateIDs !== undefined &&
369
- input.replicationConfigurationTemplateIDs !== null && {
370
- replicationConfigurationTemplateIDs: serializeAws_restJson1ReplicationConfigurationTemplateIDs(
371
- input.replicationConfigurationTemplateIDs,
372
- context
373
- ),
374
- }),
375
- });
376
- return new __HttpRequest({
377
- protocol,
378
- hostname,
379
- port,
380
- method: "POST",
381
- headers,
382
- path: resolvedPath,
383
- body,
384
- });
385
- };
386
-
387
- export const serializeAws_restJson1DescribeSourceServersCommand = async (
388
- input: DescribeSourceServersCommandInput,
389
- context: __SerdeContext
390
- ): Promise<__HttpRequest> => {
391
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
392
- const headers: any = {
393
- "content-type": "application/json",
394
- };
395
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeSourceServers";
396
- let body: any;
397
- body = JSON.stringify({
398
- ...(input.filters !== undefined &&
399
- input.filters !== null && {
400
- filters: serializeAws_restJson1DescribeSourceServersRequestFilters(input.filters, context),
401
- }),
402
- ...(input.maxResults !== undefined && input.maxResults !== null && { maxResults: input.maxResults }),
403
- ...(input.nextToken !== undefined && input.nextToken !== null && { nextToken: input.nextToken }),
404
- });
405
- return new __HttpRequest({
406
- protocol,
407
- hostname,
408
- port,
409
- method: "POST",
410
- headers,
411
- path: resolvedPath,
412
- body,
413
- });
414
- };
415
-
416
- export const serializeAws_restJson1DisconnectFromServiceCommand = async (
417
- input: DisconnectFromServiceCommandInput,
418
- context: __SerdeContext
419
- ): Promise<__HttpRequest> => {
420
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
421
- const headers: any = {
422
- "content-type": "application/json",
423
- };
424
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DisconnectFromService";
425
- let body: any;
426
- body = JSON.stringify({
427
- ...(input.sourceServerID !== undefined &&
428
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
429
- });
430
- return new __HttpRequest({
431
- protocol,
432
- hostname,
433
- port,
434
- method: "POST",
435
- headers,
436
- path: resolvedPath,
437
- body,
438
- });
439
- };
440
-
441
- export const serializeAws_restJson1FinalizeCutoverCommand = async (
442
- input: FinalizeCutoverCommandInput,
443
- context: __SerdeContext
444
- ): Promise<__HttpRequest> => {
445
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
446
- const headers: any = {
447
- "content-type": "application/json",
448
- };
449
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/FinalizeCutover";
450
- let body: any;
451
- body = JSON.stringify({
452
- ...(input.sourceServerID !== undefined &&
453
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
454
- });
455
- return new __HttpRequest({
456
- protocol,
457
- hostname,
458
- port,
459
- method: "POST",
460
- headers,
461
- path: resolvedPath,
462
- body,
463
- });
464
- };
465
-
466
- export const serializeAws_restJson1GetLaunchConfigurationCommand = async (
467
- input: GetLaunchConfigurationCommandInput,
468
- context: __SerdeContext
469
- ): Promise<__HttpRequest> => {
470
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
471
- const headers: any = {
472
- "content-type": "application/json",
473
- };
474
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetLaunchConfiguration";
475
- let body: any;
476
- body = JSON.stringify({
477
- ...(input.sourceServerID !== undefined &&
478
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
479
- });
480
- return new __HttpRequest({
481
- protocol,
482
- hostname,
483
- port,
484
- method: "POST",
485
- headers,
486
- path: resolvedPath,
487
- body,
488
- });
489
- };
490
-
491
- export const serializeAws_restJson1GetReplicationConfigurationCommand = async (
492
- input: GetReplicationConfigurationCommandInput,
493
- context: __SerdeContext
494
- ): Promise<__HttpRequest> => {
495
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
496
- const headers: any = {
497
- "content-type": "application/json",
498
- };
499
- let resolvedPath =
500
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/GetReplicationConfiguration";
501
- let body: any;
502
- body = JSON.stringify({
503
- ...(input.sourceServerID !== undefined &&
504
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
505
- });
506
- return new __HttpRequest({
507
- protocol,
508
- hostname,
509
- port,
510
- method: "POST",
511
- headers,
512
- path: resolvedPath,
513
- body,
514
- });
515
- };
516
-
517
- export const serializeAws_restJson1InitializeServiceCommand = async (
518
- input: InitializeServiceCommandInput,
519
- context: __SerdeContext
520
- ): Promise<__HttpRequest> => {
521
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
522
- const headers: any = {
523
- "content-type": "application/json",
524
- };
525
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/InitializeService";
526
- let body: any;
527
- body = "";
528
- return new __HttpRequest({
529
- protocol,
530
- hostname,
531
- port,
532
- method: "POST",
533
- headers,
534
- path: resolvedPath,
535
- body,
536
- });
537
- };
538
-
539
- export const serializeAws_restJson1ListTagsForResourceCommand = async (
540
- input: ListTagsForResourceCommandInput,
541
- context: __SerdeContext
542
- ): Promise<__HttpRequest> => {
543
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
544
- const headers: any = {};
545
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
546
- if (input.resourceArn !== undefined) {
547
- const labelValue: string = input.resourceArn;
548
- if (labelValue.length <= 0) {
549
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
550
- }
551
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
552
- } else {
553
- throw new Error("No value provided for input HTTP label: resourceArn.");
554
- }
555
- let body: any;
556
- return new __HttpRequest({
557
- protocol,
558
- hostname,
559
- port,
560
- method: "GET",
561
- headers,
562
- path: resolvedPath,
563
- body,
564
- });
565
- };
566
-
567
- export const serializeAws_restJson1MarkAsArchivedCommand = async (
568
- input: MarkAsArchivedCommandInput,
569
- context: __SerdeContext
570
- ): Promise<__HttpRequest> => {
571
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
572
- const headers: any = {
573
- "content-type": "application/json",
574
- };
575
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/MarkAsArchived";
576
- let body: any;
577
- body = JSON.stringify({
578
- ...(input.sourceServerID !== undefined &&
579
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
580
- });
581
- return new __HttpRequest({
582
- protocol,
583
- hostname,
584
- port,
585
- method: "POST",
586
- headers,
587
- path: resolvedPath,
588
- body,
589
- });
590
- };
591
-
592
- export const serializeAws_restJson1RetryDataReplicationCommand = async (
593
- input: RetryDataReplicationCommandInput,
594
- context: __SerdeContext
595
- ): Promise<__HttpRequest> => {
596
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
597
- const headers: any = {
598
- "content-type": "application/json",
599
- };
600
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/RetryDataReplication";
601
- let body: any;
602
- body = JSON.stringify({
603
- ...(input.sourceServerID !== undefined &&
604
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
605
- });
606
- return new __HttpRequest({
607
- protocol,
608
- hostname,
609
- port,
610
- method: "POST",
611
- headers,
612
- path: resolvedPath,
613
- body,
614
- });
615
- };
616
-
617
- export const serializeAws_restJson1StartCutoverCommand = async (
618
- input: StartCutoverCommandInput,
619
- context: __SerdeContext
620
- ): Promise<__HttpRequest> => {
621
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
622
- const headers: any = {
623
- "content-type": "application/json",
624
- };
625
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/StartCutover";
626
- let body: any;
627
- body = JSON.stringify({
628
- ...(input.sourceServerIDs !== undefined &&
629
- input.sourceServerIDs !== null && {
630
- sourceServerIDs: serializeAws_restJson1StartCutoverRequestSourceServerIDs(input.sourceServerIDs, context),
631
- }),
632
- ...(input.tags !== undefined &&
633
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
634
- });
635
- return new __HttpRequest({
636
- protocol,
637
- hostname,
638
- port,
639
- method: "POST",
640
- headers,
641
- path: resolvedPath,
642
- body,
643
- });
644
- };
645
-
646
- export const serializeAws_restJson1StartTestCommand = async (
647
- input: StartTestCommandInput,
648
- context: __SerdeContext
649
- ): Promise<__HttpRequest> => {
650
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
651
- const headers: any = {
652
- "content-type": "application/json",
653
- };
654
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/StartTest";
655
- let body: any;
656
- body = JSON.stringify({
657
- ...(input.sourceServerIDs !== undefined &&
658
- input.sourceServerIDs !== null && {
659
- sourceServerIDs: serializeAws_restJson1StartTestRequestSourceServerIDs(input.sourceServerIDs, context),
660
- }),
661
- ...(input.tags !== undefined &&
662
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
663
- });
664
- return new __HttpRequest({
665
- protocol,
666
- hostname,
667
- port,
668
- method: "POST",
669
- headers,
670
- path: resolvedPath,
671
- body,
672
- });
673
- };
674
-
675
- export const serializeAws_restJson1TagResourceCommand = async (
676
- input: TagResourceCommandInput,
677
- context: __SerdeContext
678
- ): Promise<__HttpRequest> => {
679
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
680
- const headers: any = {
681
- "content-type": "application/json",
682
- };
683
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
684
- if (input.resourceArn !== undefined) {
685
- const labelValue: string = input.resourceArn;
686
- if (labelValue.length <= 0) {
687
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
688
- }
689
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
690
- } else {
691
- throw new Error("No value provided for input HTTP label: resourceArn.");
692
- }
693
- let body: any;
694
- body = JSON.stringify({
695
- ...(input.tags !== undefined &&
696
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
697
- });
698
- return new __HttpRequest({
699
- protocol,
700
- hostname,
701
- port,
702
- method: "POST",
703
- headers,
704
- path: resolvedPath,
705
- body,
706
- });
707
- };
708
-
709
- export const serializeAws_restJson1TerminateTargetInstancesCommand = async (
710
- input: TerminateTargetInstancesCommandInput,
711
- context: __SerdeContext
712
- ): Promise<__HttpRequest> => {
713
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
714
- const headers: any = {
715
- "content-type": "application/json",
716
- };
717
- let resolvedPath =
718
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/TerminateTargetInstances";
719
- let body: any;
720
- body = JSON.stringify({
721
- ...(input.sourceServerIDs !== undefined &&
722
- input.sourceServerIDs !== null && {
723
- sourceServerIDs: serializeAws_restJson1TerminateTargetInstancesRequestSourceServerIDs(
724
- input.sourceServerIDs,
725
- context
726
- ),
727
- }),
728
- ...(input.tags !== undefined &&
729
- input.tags !== null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
730
- });
731
- return new __HttpRequest({
732
- protocol,
733
- hostname,
734
- port,
735
- method: "POST",
736
- headers,
737
- path: resolvedPath,
738
- body,
739
- });
740
- };
741
-
742
- export const serializeAws_restJson1UntagResourceCommand = async (
743
- input: UntagResourceCommandInput,
744
- context: __SerdeContext
745
- ): Promise<__HttpRequest> => {
746
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
747
- const headers: any = {};
748
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
749
- if (input.resourceArn !== undefined) {
750
- const labelValue: string = input.resourceArn;
751
- if (labelValue.length <= 0) {
752
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
753
- }
754
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
755
- } else {
756
- throw new Error("No value provided for input HTTP label: resourceArn.");
757
- }
758
- const query: any = {
759
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry as any) }),
760
- };
761
- let body: any;
762
- return new __HttpRequest({
763
- protocol,
764
- hostname,
765
- port,
766
- method: "DELETE",
767
- headers,
768
- path: resolvedPath,
769
- query,
770
- body,
771
- });
772
- };
773
-
774
- export const serializeAws_restJson1UpdateLaunchConfigurationCommand = async (
775
- input: UpdateLaunchConfigurationCommandInput,
776
- context: __SerdeContext
777
- ): Promise<__HttpRequest> => {
778
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
779
- const headers: any = {
780
- "content-type": "application/json",
781
- };
782
- let resolvedPath =
783
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateLaunchConfiguration";
784
- let body: any;
785
- body = JSON.stringify({
786
- ...(input.copyPrivateIp !== undefined && input.copyPrivateIp !== null && { copyPrivateIp: input.copyPrivateIp }),
787
- ...(input.copyTags !== undefined && input.copyTags !== null && { copyTags: input.copyTags }),
788
- ...(input.launchDisposition !== undefined &&
789
- input.launchDisposition !== null && { launchDisposition: input.launchDisposition }),
790
- ...(input.licensing !== undefined &&
791
- input.licensing !== null && { licensing: serializeAws_restJson1Licensing(input.licensing, context) }),
792
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
793
- ...(input.sourceServerID !== undefined &&
794
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
795
- ...(input.targetInstanceTypeRightSizingMethod !== undefined &&
796
- input.targetInstanceTypeRightSizingMethod !== null && {
797
- targetInstanceTypeRightSizingMethod: input.targetInstanceTypeRightSizingMethod,
798
- }),
799
- });
800
- return new __HttpRequest({
801
- protocol,
802
- hostname,
803
- port,
804
- method: "POST",
805
- headers,
806
- path: resolvedPath,
807
- body,
808
- });
809
- };
810
-
811
- export const serializeAws_restJson1UpdateReplicationConfigurationCommand = async (
812
- input: UpdateReplicationConfigurationCommandInput,
813
- context: __SerdeContext
814
- ): Promise<__HttpRequest> => {
815
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
816
- const headers: any = {
817
- "content-type": "application/json",
818
- };
819
- let resolvedPath =
820
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateReplicationConfiguration";
821
- let body: any;
822
- body = JSON.stringify({
823
- ...(input.associateDefaultSecurityGroup !== undefined &&
824
- input.associateDefaultSecurityGroup !== null && {
825
- associateDefaultSecurityGroup: input.associateDefaultSecurityGroup,
826
- }),
827
- ...(input.bandwidthThrottling !== undefined &&
828
- input.bandwidthThrottling !== null && { bandwidthThrottling: input.bandwidthThrottling }),
829
- ...(input.createPublicIP !== undefined &&
830
- input.createPublicIP !== null && { createPublicIP: input.createPublicIP }),
831
- ...(input.dataPlaneRouting !== undefined &&
832
- input.dataPlaneRouting !== null && { dataPlaneRouting: input.dataPlaneRouting }),
833
- ...(input.defaultLargeStagingDiskType !== undefined &&
834
- input.defaultLargeStagingDiskType !== null && { defaultLargeStagingDiskType: input.defaultLargeStagingDiskType }),
835
- ...(input.ebsEncryption !== undefined && input.ebsEncryption !== null && { ebsEncryption: input.ebsEncryption }),
836
- ...(input.ebsEncryptionKeyArn !== undefined &&
837
- input.ebsEncryptionKeyArn !== null && { ebsEncryptionKeyArn: input.ebsEncryptionKeyArn }),
838
- ...(input.name !== undefined && input.name !== null && { name: input.name }),
839
- ...(input.replicatedDisks !== undefined &&
840
- input.replicatedDisks !== null && {
841
- replicatedDisks: serializeAws_restJson1ReplicationConfigurationReplicatedDisks(input.replicatedDisks, context),
842
- }),
843
- ...(input.replicationServerInstanceType !== undefined &&
844
- input.replicationServerInstanceType !== null && {
845
- replicationServerInstanceType: input.replicationServerInstanceType,
846
- }),
847
- ...(input.replicationServersSecurityGroupsIDs !== undefined &&
848
- input.replicationServersSecurityGroupsIDs !== null && {
849
- replicationServersSecurityGroupsIDs: serializeAws_restJson1ReplicationServersSecurityGroupsIDs(
850
- input.replicationServersSecurityGroupsIDs,
851
- context
852
- ),
853
- }),
854
- ...(input.sourceServerID !== undefined &&
855
- input.sourceServerID !== null && { sourceServerID: input.sourceServerID }),
856
- ...(input.stagingAreaSubnetId !== undefined &&
857
- input.stagingAreaSubnetId !== null && { stagingAreaSubnetId: input.stagingAreaSubnetId }),
858
- ...(input.stagingAreaTags !== undefined &&
859
- input.stagingAreaTags !== null && {
860
- stagingAreaTags: serializeAws_restJson1TagsMap(input.stagingAreaTags, context),
861
- }),
862
- ...(input.useDedicatedReplicationServer !== undefined &&
863
- input.useDedicatedReplicationServer !== null && {
864
- useDedicatedReplicationServer: input.useDedicatedReplicationServer,
865
- }),
866
- });
867
- return new __HttpRequest({
868
- protocol,
869
- hostname,
870
- port,
871
- method: "POST",
872
- headers,
873
- path: resolvedPath,
874
- body,
875
- });
876
- };
877
-
878
- export const serializeAws_restJson1UpdateReplicationConfigurationTemplateCommand = async (
879
- input: UpdateReplicationConfigurationTemplateCommandInput,
880
- context: __SerdeContext
881
- ): Promise<__HttpRequest> => {
882
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
883
- const headers: any = {
884
- "content-type": "application/json",
885
- };
886
- let resolvedPath =
887
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateReplicationConfigurationTemplate";
888
- let body: any;
889
- body = JSON.stringify({
890
- ...(input.arn !== undefined && input.arn !== null && { arn: input.arn }),
891
- ...(input.associateDefaultSecurityGroup !== undefined &&
892
- input.associateDefaultSecurityGroup !== null && {
893
- associateDefaultSecurityGroup: input.associateDefaultSecurityGroup,
894
- }),
895
- ...(input.bandwidthThrottling !== undefined &&
896
- input.bandwidthThrottling !== null && { bandwidthThrottling: input.bandwidthThrottling }),
897
- ...(input.createPublicIP !== undefined &&
898
- input.createPublicIP !== null && { createPublicIP: input.createPublicIP }),
899
- ...(input.dataPlaneRouting !== undefined &&
900
- input.dataPlaneRouting !== null && { dataPlaneRouting: input.dataPlaneRouting }),
901
- ...(input.defaultLargeStagingDiskType !== undefined &&
902
- input.defaultLargeStagingDiskType !== null && { defaultLargeStagingDiskType: input.defaultLargeStagingDiskType }),
903
- ...(input.ebsEncryption !== undefined && input.ebsEncryption !== null && { ebsEncryption: input.ebsEncryption }),
904
- ...(input.ebsEncryptionKeyArn !== undefined &&
905
- input.ebsEncryptionKeyArn !== null && { ebsEncryptionKeyArn: input.ebsEncryptionKeyArn }),
906
- ...(input.replicationConfigurationTemplateID !== undefined &&
907
- input.replicationConfigurationTemplateID !== null && {
908
- replicationConfigurationTemplateID: input.replicationConfigurationTemplateID,
909
- }),
910
- ...(input.replicationServerInstanceType !== undefined &&
911
- input.replicationServerInstanceType !== null && {
912
- replicationServerInstanceType: input.replicationServerInstanceType,
913
- }),
914
- ...(input.replicationServersSecurityGroupsIDs !== undefined &&
915
- input.replicationServersSecurityGroupsIDs !== null && {
916
- replicationServersSecurityGroupsIDs: serializeAws_restJson1ReplicationServersSecurityGroupsIDs(
917
- input.replicationServersSecurityGroupsIDs,
918
- context
919
- ),
920
- }),
921
- ...(input.stagingAreaSubnetId !== undefined &&
922
- input.stagingAreaSubnetId !== null && { stagingAreaSubnetId: input.stagingAreaSubnetId }),
923
- ...(input.stagingAreaTags !== undefined &&
924
- input.stagingAreaTags !== null && {
925
- stagingAreaTags: serializeAws_restJson1TagsMap(input.stagingAreaTags, context),
926
- }),
927
- ...(input.useDedicatedReplicationServer !== undefined &&
928
- input.useDedicatedReplicationServer !== null && {
929
- useDedicatedReplicationServer: input.useDedicatedReplicationServer,
930
- }),
931
- });
932
- return new __HttpRequest({
933
- protocol,
934
- hostname,
935
- port,
936
- method: "POST",
937
- headers,
938
- path: resolvedPath,
939
- body,
940
- });
941
- };
942
-
943
- export const deserializeAws_restJson1ChangeServerLifeCycleStateCommand = async (
944
- output: __HttpResponse,
945
- context: __SerdeContext
946
- ): Promise<ChangeServerLifeCycleStateCommandOutput> => {
947
- if (output.statusCode !== 200 && output.statusCode >= 300) {
948
- return deserializeAws_restJson1ChangeServerLifeCycleStateCommandError(output, context);
949
- }
950
- const contents: ChangeServerLifeCycleStateCommandOutput = {
951
- $metadata: deserializeMetadata(output),
952
- arn: undefined,
953
- dataReplicationInfo: undefined,
954
- isArchived: undefined,
955
- launchedInstance: undefined,
956
- lifeCycle: undefined,
957
- sourceProperties: undefined,
958
- sourceServerID: undefined,
959
- tags: undefined,
960
- };
961
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
962
- if (data.arn !== undefined && data.arn !== null) {
963
- contents.arn = __expectString(data.arn);
964
- }
965
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
966
- contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
967
- }
968
- if (data.isArchived !== undefined && data.isArchived !== null) {
969
- contents.isArchived = __expectBoolean(data.isArchived);
970
- }
971
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
972
- contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
973
- }
974
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
975
- contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
976
- }
977
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
978
- contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
979
- }
980
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
981
- contents.sourceServerID = __expectString(data.sourceServerID);
982
- }
983
- if (data.tags !== undefined && data.tags !== null) {
984
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
985
- }
986
- return Promise.resolve(contents);
987
- };
988
-
989
- const deserializeAws_restJson1ChangeServerLifeCycleStateCommandError = async (
990
- output: __HttpResponse,
991
- context: __SerdeContext
992
- ): Promise<ChangeServerLifeCycleStateCommandOutput> => {
993
- const parsedOutput: any = {
994
- ...output,
995
- body: await parseBody(output.body, context),
996
- };
997
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
998
- let errorCode: string = "UnknownError";
999
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1000
- switch (errorCode) {
1001
- case "ConflictException":
1002
- case "com.amazonaws.mgn#ConflictException":
1003
- response = {
1004
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1005
- name: errorCode,
1006
- $metadata: deserializeMetadata(output),
1007
- };
1008
- break;
1009
- case "ResourceNotFoundException":
1010
- case "com.amazonaws.mgn#ResourceNotFoundException":
1011
- response = {
1012
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1013
- name: errorCode,
1014
- $metadata: deserializeMetadata(output),
1015
- };
1016
- break;
1017
- case "UninitializedAccountException":
1018
- case "com.amazonaws.mgn#UninitializedAccountException":
1019
- response = {
1020
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1021
- name: errorCode,
1022
- $metadata: deserializeMetadata(output),
1023
- };
1024
- break;
1025
- case "ValidationException":
1026
- case "com.amazonaws.mgn#ValidationException":
1027
- response = {
1028
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1029
- name: errorCode,
1030
- $metadata: deserializeMetadata(output),
1031
- };
1032
- break;
1033
- default:
1034
- const parsedBody = parsedOutput.body;
1035
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1036
- response = {
1037
- ...parsedBody,
1038
- name: `${errorCode}`,
1039
- message: parsedBody.message || parsedBody.Message || errorCode,
1040
- $fault: "client",
1041
- $metadata: deserializeMetadata(output),
1042
- } as any;
1043
- }
1044
- const message = response.message || response.Message || errorCode;
1045
- response.message = message;
1046
- delete response.Message;
1047
- return Promise.reject(Object.assign(new Error(message), response));
1048
- };
1049
-
1050
- export const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand = async (
1051
- output: __HttpResponse,
1052
- context: __SerdeContext
1053
- ): Promise<CreateReplicationConfigurationTemplateCommandOutput> => {
1054
- if (output.statusCode !== 201 && output.statusCode >= 300) {
1055
- return deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError(output, context);
1056
- }
1057
- const contents: CreateReplicationConfigurationTemplateCommandOutput = {
1058
- $metadata: deserializeMetadata(output),
1059
- arn: undefined,
1060
- associateDefaultSecurityGroup: undefined,
1061
- bandwidthThrottling: undefined,
1062
- createPublicIP: undefined,
1063
- dataPlaneRouting: undefined,
1064
- defaultLargeStagingDiskType: undefined,
1065
- ebsEncryption: undefined,
1066
- ebsEncryptionKeyArn: undefined,
1067
- replicationConfigurationTemplateID: undefined,
1068
- replicationServerInstanceType: undefined,
1069
- replicationServersSecurityGroupsIDs: undefined,
1070
- stagingAreaSubnetId: undefined,
1071
- stagingAreaTags: undefined,
1072
- tags: undefined,
1073
- useDedicatedReplicationServer: undefined,
1074
- };
1075
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1076
- if (data.arn !== undefined && data.arn !== null) {
1077
- contents.arn = __expectString(data.arn);
1078
- }
1079
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
1080
- contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
1081
- }
1082
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
1083
- contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
1084
- }
1085
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
1086
- contents.createPublicIP = __expectBoolean(data.createPublicIP);
1087
- }
1088
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
1089
- contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
1090
- }
1091
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
1092
- contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
1093
- }
1094
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
1095
- contents.ebsEncryption = __expectString(data.ebsEncryption);
1096
- }
1097
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
1098
- contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
1099
- }
1100
- if (data.replicationConfigurationTemplateID !== undefined && data.replicationConfigurationTemplateID !== null) {
1101
- contents.replicationConfigurationTemplateID = __expectString(data.replicationConfigurationTemplateID);
1102
- }
1103
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
1104
- contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
1105
- }
1106
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
1107
- contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(
1108
- data.replicationServersSecurityGroupsIDs,
1109
- context
1110
- );
1111
- }
1112
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
1113
- contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
1114
- }
1115
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
1116
- contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
1117
- }
1118
- if (data.tags !== undefined && data.tags !== null) {
1119
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1120
- }
1121
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
1122
- contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
1123
- }
1124
- return Promise.resolve(contents);
1125
- };
1126
-
1127
- const deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError = async (
1128
- output: __HttpResponse,
1129
- context: __SerdeContext
1130
- ): Promise<CreateReplicationConfigurationTemplateCommandOutput> => {
1131
- const parsedOutput: any = {
1132
- ...output,
1133
- body: await parseBody(output.body, context),
1134
- };
1135
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1136
- let errorCode: string = "UnknownError";
1137
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1138
- switch (errorCode) {
1139
- case "AccessDeniedException":
1140
- case "com.amazonaws.mgn#AccessDeniedException":
1141
- response = {
1142
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1143
- name: errorCode,
1144
- $metadata: deserializeMetadata(output),
1145
- };
1146
- break;
1147
- case "UninitializedAccountException":
1148
- case "com.amazonaws.mgn#UninitializedAccountException":
1149
- response = {
1150
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1151
- name: errorCode,
1152
- $metadata: deserializeMetadata(output),
1153
- };
1154
- break;
1155
- case "ValidationException":
1156
- case "com.amazonaws.mgn#ValidationException":
1157
- response = {
1158
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1159
- name: errorCode,
1160
- $metadata: deserializeMetadata(output),
1161
- };
1162
- break;
1163
- default:
1164
- const parsedBody = parsedOutput.body;
1165
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1166
- response = {
1167
- ...parsedBody,
1168
- name: `${errorCode}`,
1169
- message: parsedBody.message || parsedBody.Message || errorCode,
1170
- $fault: "client",
1171
- $metadata: deserializeMetadata(output),
1172
- } as any;
1173
- }
1174
- const message = response.message || response.Message || errorCode;
1175
- response.message = message;
1176
- delete response.Message;
1177
- return Promise.reject(Object.assign(new Error(message), response));
1178
- };
1179
-
1180
- export const deserializeAws_restJson1DeleteJobCommand = async (
1181
- output: __HttpResponse,
1182
- context: __SerdeContext
1183
- ): Promise<DeleteJobCommandOutput> => {
1184
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1185
- return deserializeAws_restJson1DeleteJobCommandError(output, context);
1186
- }
1187
- const contents: DeleteJobCommandOutput = {
1188
- $metadata: deserializeMetadata(output),
1189
- };
1190
- await collectBody(output.body, context);
1191
- return Promise.resolve(contents);
1192
- };
1193
-
1194
- const deserializeAws_restJson1DeleteJobCommandError = async (
1195
- output: __HttpResponse,
1196
- context: __SerdeContext
1197
- ): Promise<DeleteJobCommandOutput> => {
1198
- const parsedOutput: any = {
1199
- ...output,
1200
- body: await parseBody(output.body, context),
1201
- };
1202
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1203
- let errorCode: string = "UnknownError";
1204
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1205
- switch (errorCode) {
1206
- case "ConflictException":
1207
- case "com.amazonaws.mgn#ConflictException":
1208
- response = {
1209
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1210
- name: errorCode,
1211
- $metadata: deserializeMetadata(output),
1212
- };
1213
- break;
1214
- case "ResourceNotFoundException":
1215
- case "com.amazonaws.mgn#ResourceNotFoundException":
1216
- response = {
1217
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1218
- name: errorCode,
1219
- $metadata: deserializeMetadata(output),
1220
- };
1221
- break;
1222
- case "UninitializedAccountException":
1223
- case "com.amazonaws.mgn#UninitializedAccountException":
1224
- response = {
1225
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1226
- name: errorCode,
1227
- $metadata: deserializeMetadata(output),
1228
- };
1229
- break;
1230
- default:
1231
- const parsedBody = parsedOutput.body;
1232
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1233
- response = {
1234
- ...parsedBody,
1235
- name: `${errorCode}`,
1236
- message: parsedBody.message || parsedBody.Message || errorCode,
1237
- $fault: "client",
1238
- $metadata: deserializeMetadata(output),
1239
- } as any;
1240
- }
1241
- const message = response.message || response.Message || errorCode;
1242
- response.message = message;
1243
- delete response.Message;
1244
- return Promise.reject(Object.assign(new Error(message), response));
1245
- };
1246
-
1247
- export const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand = async (
1248
- output: __HttpResponse,
1249
- context: __SerdeContext
1250
- ): Promise<DeleteReplicationConfigurationTemplateCommandOutput> => {
1251
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1252
- return deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError(output, context);
1253
- }
1254
- const contents: DeleteReplicationConfigurationTemplateCommandOutput = {
1255
- $metadata: deserializeMetadata(output),
1256
- };
1257
- await collectBody(output.body, context);
1258
- return Promise.resolve(contents);
1259
- };
1260
-
1261
- const deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError = async (
1262
- output: __HttpResponse,
1263
- context: __SerdeContext
1264
- ): Promise<DeleteReplicationConfigurationTemplateCommandOutput> => {
1265
- const parsedOutput: any = {
1266
- ...output,
1267
- body: await parseBody(output.body, context),
1268
- };
1269
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1270
- let errorCode: string = "UnknownError";
1271
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1272
- switch (errorCode) {
1273
- case "ConflictException":
1274
- case "com.amazonaws.mgn#ConflictException":
1275
- response = {
1276
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1277
- name: errorCode,
1278
- $metadata: deserializeMetadata(output),
1279
- };
1280
- break;
1281
- case "ResourceNotFoundException":
1282
- case "com.amazonaws.mgn#ResourceNotFoundException":
1283
- response = {
1284
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1285
- name: errorCode,
1286
- $metadata: deserializeMetadata(output),
1287
- };
1288
- break;
1289
- case "UninitializedAccountException":
1290
- case "com.amazonaws.mgn#UninitializedAccountException":
1291
- response = {
1292
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1293
- name: errorCode,
1294
- $metadata: deserializeMetadata(output),
1295
- };
1296
- break;
1297
- default:
1298
- const parsedBody = parsedOutput.body;
1299
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1300
- response = {
1301
- ...parsedBody,
1302
- name: `${errorCode}`,
1303
- message: parsedBody.message || parsedBody.Message || errorCode,
1304
- $fault: "client",
1305
- $metadata: deserializeMetadata(output),
1306
- } as any;
1307
- }
1308
- const message = response.message || response.Message || errorCode;
1309
- response.message = message;
1310
- delete response.Message;
1311
- return Promise.reject(Object.assign(new Error(message), response));
1312
- };
1313
-
1314
- export const deserializeAws_restJson1DeleteSourceServerCommand = async (
1315
- output: __HttpResponse,
1316
- context: __SerdeContext
1317
- ): Promise<DeleteSourceServerCommandOutput> => {
1318
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1319
- return deserializeAws_restJson1DeleteSourceServerCommandError(output, context);
1320
- }
1321
- const contents: DeleteSourceServerCommandOutput = {
1322
- $metadata: deserializeMetadata(output),
1323
- };
1324
- await collectBody(output.body, context);
1325
- return Promise.resolve(contents);
1326
- };
1327
-
1328
- const deserializeAws_restJson1DeleteSourceServerCommandError = async (
1329
- output: __HttpResponse,
1330
- context: __SerdeContext
1331
- ): Promise<DeleteSourceServerCommandOutput> => {
1332
- const parsedOutput: any = {
1333
- ...output,
1334
- body: await parseBody(output.body, context),
1335
- };
1336
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1337
- let errorCode: string = "UnknownError";
1338
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1339
- switch (errorCode) {
1340
- case "ConflictException":
1341
- case "com.amazonaws.mgn#ConflictException":
1342
- response = {
1343
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1344
- name: errorCode,
1345
- $metadata: deserializeMetadata(output),
1346
- };
1347
- break;
1348
- case "ResourceNotFoundException":
1349
- case "com.amazonaws.mgn#ResourceNotFoundException":
1350
- response = {
1351
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1352
- name: errorCode,
1353
- $metadata: deserializeMetadata(output),
1354
- };
1355
- break;
1356
- case "UninitializedAccountException":
1357
- case "com.amazonaws.mgn#UninitializedAccountException":
1358
- response = {
1359
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1360
- name: errorCode,
1361
- $metadata: deserializeMetadata(output),
1362
- };
1363
- break;
1364
- default:
1365
- const parsedBody = parsedOutput.body;
1366
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1367
- response = {
1368
- ...parsedBody,
1369
- name: `${errorCode}`,
1370
- message: parsedBody.message || parsedBody.Message || errorCode,
1371
- $fault: "client",
1372
- $metadata: deserializeMetadata(output),
1373
- } as any;
1374
- }
1375
- const message = response.message || response.Message || errorCode;
1376
- response.message = message;
1377
- delete response.Message;
1378
- return Promise.reject(Object.assign(new Error(message), response));
1379
- };
1380
-
1381
- export const deserializeAws_restJson1DescribeJobLogItemsCommand = async (
1382
- output: __HttpResponse,
1383
- context: __SerdeContext
1384
- ): Promise<DescribeJobLogItemsCommandOutput> => {
1385
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1386
- return deserializeAws_restJson1DescribeJobLogItemsCommandError(output, context);
1387
- }
1388
- const contents: DescribeJobLogItemsCommandOutput = {
1389
- $metadata: deserializeMetadata(output),
1390
- items: undefined,
1391
- nextToken: undefined,
1392
- };
1393
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1394
- if (data.items !== undefined && data.items !== null) {
1395
- contents.items = deserializeAws_restJson1JobLogs(data.items, context);
1396
- }
1397
- if (data.nextToken !== undefined && data.nextToken !== null) {
1398
- contents.nextToken = __expectString(data.nextToken);
1399
- }
1400
- return Promise.resolve(contents);
1401
- };
1402
-
1403
- const deserializeAws_restJson1DescribeJobLogItemsCommandError = async (
1404
- output: __HttpResponse,
1405
- context: __SerdeContext
1406
- ): Promise<DescribeJobLogItemsCommandOutput> => {
1407
- const parsedOutput: any = {
1408
- ...output,
1409
- body: await parseBody(output.body, context),
1410
- };
1411
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1412
- let errorCode: string = "UnknownError";
1413
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1414
- switch (errorCode) {
1415
- case "UninitializedAccountException":
1416
- case "com.amazonaws.mgn#UninitializedAccountException":
1417
- response = {
1418
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1419
- name: errorCode,
1420
- $metadata: deserializeMetadata(output),
1421
- };
1422
- break;
1423
- case "ValidationException":
1424
- case "com.amazonaws.mgn#ValidationException":
1425
- response = {
1426
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1427
- name: errorCode,
1428
- $metadata: deserializeMetadata(output),
1429
- };
1430
- break;
1431
- default:
1432
- const parsedBody = parsedOutput.body;
1433
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1434
- response = {
1435
- ...parsedBody,
1436
- name: `${errorCode}`,
1437
- message: parsedBody.message || parsedBody.Message || errorCode,
1438
- $fault: "client",
1439
- $metadata: deserializeMetadata(output),
1440
- } as any;
1441
- }
1442
- const message = response.message || response.Message || errorCode;
1443
- response.message = message;
1444
- delete response.Message;
1445
- return Promise.reject(Object.assign(new Error(message), response));
1446
- };
1447
-
1448
- export const deserializeAws_restJson1DescribeJobsCommand = async (
1449
- output: __HttpResponse,
1450
- context: __SerdeContext
1451
- ): Promise<DescribeJobsCommandOutput> => {
1452
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1453
- return deserializeAws_restJson1DescribeJobsCommandError(output, context);
1454
- }
1455
- const contents: DescribeJobsCommandOutput = {
1456
- $metadata: deserializeMetadata(output),
1457
- items: undefined,
1458
- nextToken: undefined,
1459
- };
1460
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1461
- if (data.items !== undefined && data.items !== null) {
1462
- contents.items = deserializeAws_restJson1JobsList(data.items, context);
1463
- }
1464
- if (data.nextToken !== undefined && data.nextToken !== null) {
1465
- contents.nextToken = __expectString(data.nextToken);
1466
- }
1467
- return Promise.resolve(contents);
1468
- };
1469
-
1470
- const deserializeAws_restJson1DescribeJobsCommandError = async (
1471
- output: __HttpResponse,
1472
- context: __SerdeContext
1473
- ): Promise<DescribeJobsCommandOutput> => {
1474
- const parsedOutput: any = {
1475
- ...output,
1476
- body: await parseBody(output.body, context),
1477
- };
1478
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1479
- let errorCode: string = "UnknownError";
1480
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1481
- switch (errorCode) {
1482
- case "UninitializedAccountException":
1483
- case "com.amazonaws.mgn#UninitializedAccountException":
1484
- response = {
1485
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1486
- name: errorCode,
1487
- $metadata: deserializeMetadata(output),
1488
- };
1489
- break;
1490
- case "ValidationException":
1491
- case "com.amazonaws.mgn#ValidationException":
1492
- response = {
1493
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1494
- name: errorCode,
1495
- $metadata: deserializeMetadata(output),
1496
- };
1497
- break;
1498
- default:
1499
- const parsedBody = parsedOutput.body;
1500
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1501
- response = {
1502
- ...parsedBody,
1503
- name: `${errorCode}`,
1504
- message: parsedBody.message || parsedBody.Message || errorCode,
1505
- $fault: "client",
1506
- $metadata: deserializeMetadata(output),
1507
- } as any;
1508
- }
1509
- const message = response.message || response.Message || errorCode;
1510
- response.message = message;
1511
- delete response.Message;
1512
- return Promise.reject(Object.assign(new Error(message), response));
1513
- };
1514
-
1515
- export const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand = async (
1516
- output: __HttpResponse,
1517
- context: __SerdeContext
1518
- ): Promise<DescribeReplicationConfigurationTemplatesCommandOutput> => {
1519
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1520
- return deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError(output, context);
1521
- }
1522
- const contents: DescribeReplicationConfigurationTemplatesCommandOutput = {
1523
- $metadata: deserializeMetadata(output),
1524
- items: undefined,
1525
- nextToken: undefined,
1526
- };
1527
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1528
- if (data.items !== undefined && data.items !== null) {
1529
- contents.items = deserializeAws_restJson1ReplicationConfigurationTemplates(data.items, context);
1530
- }
1531
- if (data.nextToken !== undefined && data.nextToken !== null) {
1532
- contents.nextToken = __expectString(data.nextToken);
1533
- }
1534
- return Promise.resolve(contents);
1535
- };
1536
-
1537
- const deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError = async (
1538
- output: __HttpResponse,
1539
- context: __SerdeContext
1540
- ): Promise<DescribeReplicationConfigurationTemplatesCommandOutput> => {
1541
- const parsedOutput: any = {
1542
- ...output,
1543
- body: await parseBody(output.body, context),
1544
- };
1545
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1546
- let errorCode: string = "UnknownError";
1547
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1548
- switch (errorCode) {
1549
- case "ResourceNotFoundException":
1550
- case "com.amazonaws.mgn#ResourceNotFoundException":
1551
- response = {
1552
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1553
- name: errorCode,
1554
- $metadata: deserializeMetadata(output),
1555
- };
1556
- break;
1557
- case "UninitializedAccountException":
1558
- case "com.amazonaws.mgn#UninitializedAccountException":
1559
- response = {
1560
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1561
- name: errorCode,
1562
- $metadata: deserializeMetadata(output),
1563
- };
1564
- break;
1565
- case "ValidationException":
1566
- case "com.amazonaws.mgn#ValidationException":
1567
- response = {
1568
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1569
- name: errorCode,
1570
- $metadata: deserializeMetadata(output),
1571
- };
1572
- break;
1573
- default:
1574
- const parsedBody = parsedOutput.body;
1575
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1576
- response = {
1577
- ...parsedBody,
1578
- name: `${errorCode}`,
1579
- message: parsedBody.message || parsedBody.Message || errorCode,
1580
- $fault: "client",
1581
- $metadata: deserializeMetadata(output),
1582
- } as any;
1583
- }
1584
- const message = response.message || response.Message || errorCode;
1585
- response.message = message;
1586
- delete response.Message;
1587
- return Promise.reject(Object.assign(new Error(message), response));
1588
- };
1589
-
1590
- export const deserializeAws_restJson1DescribeSourceServersCommand = async (
1591
- output: __HttpResponse,
1592
- context: __SerdeContext
1593
- ): Promise<DescribeSourceServersCommandOutput> => {
1594
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1595
- return deserializeAws_restJson1DescribeSourceServersCommandError(output, context);
1596
- }
1597
- const contents: DescribeSourceServersCommandOutput = {
1598
- $metadata: deserializeMetadata(output),
1599
- items: undefined,
1600
- nextToken: undefined,
1601
- };
1602
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1603
- if (data.items !== undefined && data.items !== null) {
1604
- contents.items = deserializeAws_restJson1SourceServersList(data.items, context);
1605
- }
1606
- if (data.nextToken !== undefined && data.nextToken !== null) {
1607
- contents.nextToken = __expectString(data.nextToken);
1608
- }
1609
- return Promise.resolve(contents);
1610
- };
1611
-
1612
- const deserializeAws_restJson1DescribeSourceServersCommandError = async (
1613
- output: __HttpResponse,
1614
- context: __SerdeContext
1615
- ): Promise<DescribeSourceServersCommandOutput> => {
1616
- const parsedOutput: any = {
1617
- ...output,
1618
- body: await parseBody(output.body, context),
1619
- };
1620
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1621
- let errorCode: string = "UnknownError";
1622
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1623
- switch (errorCode) {
1624
- case "UninitializedAccountException":
1625
- case "com.amazonaws.mgn#UninitializedAccountException":
1626
- response = {
1627
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1628
- name: errorCode,
1629
- $metadata: deserializeMetadata(output),
1630
- };
1631
- break;
1632
- case "ValidationException":
1633
- case "com.amazonaws.mgn#ValidationException":
1634
- response = {
1635
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1636
- name: errorCode,
1637
- $metadata: deserializeMetadata(output),
1638
- };
1639
- break;
1640
- default:
1641
- const parsedBody = parsedOutput.body;
1642
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1643
- response = {
1644
- ...parsedBody,
1645
- name: `${errorCode}`,
1646
- message: parsedBody.message || parsedBody.Message || errorCode,
1647
- $fault: "client",
1648
- $metadata: deserializeMetadata(output),
1649
- } as any;
1650
- }
1651
- const message = response.message || response.Message || errorCode;
1652
- response.message = message;
1653
- delete response.Message;
1654
- return Promise.reject(Object.assign(new Error(message), response));
1655
- };
1656
-
1657
- export const deserializeAws_restJson1DisconnectFromServiceCommand = async (
1658
- output: __HttpResponse,
1659
- context: __SerdeContext
1660
- ): Promise<DisconnectFromServiceCommandOutput> => {
1661
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1662
- return deserializeAws_restJson1DisconnectFromServiceCommandError(output, context);
1663
- }
1664
- const contents: DisconnectFromServiceCommandOutput = {
1665
- $metadata: deserializeMetadata(output),
1666
- arn: undefined,
1667
- dataReplicationInfo: undefined,
1668
- isArchived: undefined,
1669
- launchedInstance: undefined,
1670
- lifeCycle: undefined,
1671
- sourceProperties: undefined,
1672
- sourceServerID: undefined,
1673
- tags: undefined,
1674
- };
1675
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1676
- if (data.arn !== undefined && data.arn !== null) {
1677
- contents.arn = __expectString(data.arn);
1678
- }
1679
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
1680
- contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
1681
- }
1682
- if (data.isArchived !== undefined && data.isArchived !== null) {
1683
- contents.isArchived = __expectBoolean(data.isArchived);
1684
- }
1685
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
1686
- contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
1687
- }
1688
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
1689
- contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
1690
- }
1691
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
1692
- contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
1693
- }
1694
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1695
- contents.sourceServerID = __expectString(data.sourceServerID);
1696
- }
1697
- if (data.tags !== undefined && data.tags !== null) {
1698
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1699
- }
1700
- return Promise.resolve(contents);
1701
- };
1702
-
1703
- const deserializeAws_restJson1DisconnectFromServiceCommandError = async (
1704
- output: __HttpResponse,
1705
- context: __SerdeContext
1706
- ): Promise<DisconnectFromServiceCommandOutput> => {
1707
- const parsedOutput: any = {
1708
- ...output,
1709
- body: await parseBody(output.body, context),
1710
- };
1711
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1712
- let errorCode: string = "UnknownError";
1713
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1714
- switch (errorCode) {
1715
- case "ConflictException":
1716
- case "com.amazonaws.mgn#ConflictException":
1717
- response = {
1718
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1719
- name: errorCode,
1720
- $metadata: deserializeMetadata(output),
1721
- };
1722
- break;
1723
- case "ResourceNotFoundException":
1724
- case "com.amazonaws.mgn#ResourceNotFoundException":
1725
- response = {
1726
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1727
- name: errorCode,
1728
- $metadata: deserializeMetadata(output),
1729
- };
1730
- break;
1731
- case "UninitializedAccountException":
1732
- case "com.amazonaws.mgn#UninitializedAccountException":
1733
- response = {
1734
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1735
- name: errorCode,
1736
- $metadata: deserializeMetadata(output),
1737
- };
1738
- break;
1739
- default:
1740
- const parsedBody = parsedOutput.body;
1741
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1742
- response = {
1743
- ...parsedBody,
1744
- name: `${errorCode}`,
1745
- message: parsedBody.message || parsedBody.Message || errorCode,
1746
- $fault: "client",
1747
- $metadata: deserializeMetadata(output),
1748
- } as any;
1749
- }
1750
- const message = response.message || response.Message || errorCode;
1751
- response.message = message;
1752
- delete response.Message;
1753
- return Promise.reject(Object.assign(new Error(message), response));
1754
- };
1755
-
1756
- export const deserializeAws_restJson1FinalizeCutoverCommand = async (
1757
- output: __HttpResponse,
1758
- context: __SerdeContext
1759
- ): Promise<FinalizeCutoverCommandOutput> => {
1760
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1761
- return deserializeAws_restJson1FinalizeCutoverCommandError(output, context);
1762
- }
1763
- const contents: FinalizeCutoverCommandOutput = {
1764
- $metadata: deserializeMetadata(output),
1765
- arn: undefined,
1766
- dataReplicationInfo: undefined,
1767
- isArchived: undefined,
1768
- launchedInstance: undefined,
1769
- lifeCycle: undefined,
1770
- sourceProperties: undefined,
1771
- sourceServerID: undefined,
1772
- tags: undefined,
1773
- };
1774
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1775
- if (data.arn !== undefined && data.arn !== null) {
1776
- contents.arn = __expectString(data.arn);
1777
- }
1778
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
1779
- contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
1780
- }
1781
- if (data.isArchived !== undefined && data.isArchived !== null) {
1782
- contents.isArchived = __expectBoolean(data.isArchived);
1783
- }
1784
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
1785
- contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
1786
- }
1787
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
1788
- contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
1789
- }
1790
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
1791
- contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
1792
- }
1793
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1794
- contents.sourceServerID = __expectString(data.sourceServerID);
1795
- }
1796
- if (data.tags !== undefined && data.tags !== null) {
1797
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1798
- }
1799
- return Promise.resolve(contents);
1800
- };
1801
-
1802
- const deserializeAws_restJson1FinalizeCutoverCommandError = async (
1803
- output: __HttpResponse,
1804
- context: __SerdeContext
1805
- ): Promise<FinalizeCutoverCommandOutput> => {
1806
- const parsedOutput: any = {
1807
- ...output,
1808
- body: await parseBody(output.body, context),
1809
- };
1810
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1811
- let errorCode: string = "UnknownError";
1812
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1813
- switch (errorCode) {
1814
- case "ConflictException":
1815
- case "com.amazonaws.mgn#ConflictException":
1816
- response = {
1817
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1818
- name: errorCode,
1819
- $metadata: deserializeMetadata(output),
1820
- };
1821
- break;
1822
- case "ResourceNotFoundException":
1823
- case "com.amazonaws.mgn#ResourceNotFoundException":
1824
- response = {
1825
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1826
- name: errorCode,
1827
- $metadata: deserializeMetadata(output),
1828
- };
1829
- break;
1830
- case "UninitializedAccountException":
1831
- case "com.amazonaws.mgn#UninitializedAccountException":
1832
- response = {
1833
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1834
- name: errorCode,
1835
- $metadata: deserializeMetadata(output),
1836
- };
1837
- break;
1838
- case "ValidationException":
1839
- case "com.amazonaws.mgn#ValidationException":
1840
- response = {
1841
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1842
- name: errorCode,
1843
- $metadata: deserializeMetadata(output),
1844
- };
1845
- break;
1846
- default:
1847
- const parsedBody = parsedOutput.body;
1848
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1849
- response = {
1850
- ...parsedBody,
1851
- name: `${errorCode}`,
1852
- message: parsedBody.message || parsedBody.Message || errorCode,
1853
- $fault: "client",
1854
- $metadata: deserializeMetadata(output),
1855
- } as any;
1856
- }
1857
- const message = response.message || response.Message || errorCode;
1858
- response.message = message;
1859
- delete response.Message;
1860
- return Promise.reject(Object.assign(new Error(message), response));
1861
- };
1862
-
1863
- export const deserializeAws_restJson1GetLaunchConfigurationCommand = async (
1864
- output: __HttpResponse,
1865
- context: __SerdeContext
1866
- ): Promise<GetLaunchConfigurationCommandOutput> => {
1867
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1868
- return deserializeAws_restJson1GetLaunchConfigurationCommandError(output, context);
1869
- }
1870
- const contents: GetLaunchConfigurationCommandOutput = {
1871
- $metadata: deserializeMetadata(output),
1872
- copyPrivateIp: undefined,
1873
- copyTags: undefined,
1874
- ec2LaunchTemplateID: undefined,
1875
- launchDisposition: undefined,
1876
- licensing: undefined,
1877
- name: undefined,
1878
- sourceServerID: undefined,
1879
- targetInstanceTypeRightSizingMethod: undefined,
1880
- };
1881
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1882
- if (data.copyPrivateIp !== undefined && data.copyPrivateIp !== null) {
1883
- contents.copyPrivateIp = __expectBoolean(data.copyPrivateIp);
1884
- }
1885
- if (data.copyTags !== undefined && data.copyTags !== null) {
1886
- contents.copyTags = __expectBoolean(data.copyTags);
1887
- }
1888
- if (data.ec2LaunchTemplateID !== undefined && data.ec2LaunchTemplateID !== null) {
1889
- contents.ec2LaunchTemplateID = __expectString(data.ec2LaunchTemplateID);
1890
- }
1891
- if (data.launchDisposition !== undefined && data.launchDisposition !== null) {
1892
- contents.launchDisposition = __expectString(data.launchDisposition);
1893
- }
1894
- if (data.licensing !== undefined && data.licensing !== null) {
1895
- contents.licensing = deserializeAws_restJson1Licensing(data.licensing, context);
1896
- }
1897
- if (data.name !== undefined && data.name !== null) {
1898
- contents.name = __expectString(data.name);
1899
- }
1900
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
1901
- contents.sourceServerID = __expectString(data.sourceServerID);
1902
- }
1903
- if (data.targetInstanceTypeRightSizingMethod !== undefined && data.targetInstanceTypeRightSizingMethod !== null) {
1904
- contents.targetInstanceTypeRightSizingMethod = __expectString(data.targetInstanceTypeRightSizingMethod);
1905
- }
1906
- return Promise.resolve(contents);
1907
- };
1908
-
1909
- const deserializeAws_restJson1GetLaunchConfigurationCommandError = async (
1910
- output: __HttpResponse,
1911
- context: __SerdeContext
1912
- ): Promise<GetLaunchConfigurationCommandOutput> => {
1913
- const parsedOutput: any = {
1914
- ...output,
1915
- body: await parseBody(output.body, context),
1916
- };
1917
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1918
- let errorCode: string = "UnknownError";
1919
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1920
- switch (errorCode) {
1921
- case "ResourceNotFoundException":
1922
- case "com.amazonaws.mgn#ResourceNotFoundException":
1923
- response = {
1924
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1925
- name: errorCode,
1926
- $metadata: deserializeMetadata(output),
1927
- };
1928
- break;
1929
- case "UninitializedAccountException":
1930
- case "com.amazonaws.mgn#UninitializedAccountException":
1931
- response = {
1932
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
1933
- name: errorCode,
1934
- $metadata: deserializeMetadata(output),
1935
- };
1936
- break;
1937
- default:
1938
- const parsedBody = parsedOutput.body;
1939
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1940
- response = {
1941
- ...parsedBody,
1942
- name: `${errorCode}`,
1943
- message: parsedBody.message || parsedBody.Message || errorCode,
1944
- $fault: "client",
1945
- $metadata: deserializeMetadata(output),
1946
- } as any;
1947
- }
1948
- const message = response.message || response.Message || errorCode;
1949
- response.message = message;
1950
- delete response.Message;
1951
- return Promise.reject(Object.assign(new Error(message), response));
1952
- };
1953
-
1954
- export const deserializeAws_restJson1GetReplicationConfigurationCommand = async (
1955
- output: __HttpResponse,
1956
- context: __SerdeContext
1957
- ): Promise<GetReplicationConfigurationCommandOutput> => {
1958
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1959
- return deserializeAws_restJson1GetReplicationConfigurationCommandError(output, context);
1960
- }
1961
- const contents: GetReplicationConfigurationCommandOutput = {
1962
- $metadata: deserializeMetadata(output),
1963
- associateDefaultSecurityGroup: undefined,
1964
- bandwidthThrottling: undefined,
1965
- createPublicIP: undefined,
1966
- dataPlaneRouting: undefined,
1967
- defaultLargeStagingDiskType: undefined,
1968
- ebsEncryption: undefined,
1969
- ebsEncryptionKeyArn: undefined,
1970
- name: undefined,
1971
- replicatedDisks: undefined,
1972
- replicationServerInstanceType: undefined,
1973
- replicationServersSecurityGroupsIDs: undefined,
1974
- sourceServerID: undefined,
1975
- stagingAreaSubnetId: undefined,
1976
- stagingAreaTags: undefined,
1977
- useDedicatedReplicationServer: undefined,
1978
- };
1979
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1980
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
1981
- contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
1982
- }
1983
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
1984
- contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
1985
- }
1986
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
1987
- contents.createPublicIP = __expectBoolean(data.createPublicIP);
1988
- }
1989
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
1990
- contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
1991
- }
1992
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
1993
- contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
1994
- }
1995
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
1996
- contents.ebsEncryption = __expectString(data.ebsEncryption);
1997
- }
1998
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
1999
- contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
2000
- }
2001
- if (data.name !== undefined && data.name !== null) {
2002
- contents.name = __expectString(data.name);
2003
- }
2004
- if (data.replicatedDisks !== undefined && data.replicatedDisks !== null) {
2005
- contents.replicatedDisks = deserializeAws_restJson1ReplicationConfigurationReplicatedDisks(
2006
- data.replicatedDisks,
2007
- context
2008
- );
2009
- }
2010
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
2011
- contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
2012
- }
2013
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
2014
- contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(
2015
- data.replicationServersSecurityGroupsIDs,
2016
- context
2017
- );
2018
- }
2019
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2020
- contents.sourceServerID = __expectString(data.sourceServerID);
2021
- }
2022
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
2023
- contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
2024
- }
2025
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
2026
- contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
2027
- }
2028
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
2029
- contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
2030
- }
2031
- return Promise.resolve(contents);
2032
- };
2033
-
2034
- const deserializeAws_restJson1GetReplicationConfigurationCommandError = async (
2035
- output: __HttpResponse,
2036
- context: __SerdeContext
2037
- ): Promise<GetReplicationConfigurationCommandOutput> => {
2038
- const parsedOutput: any = {
2039
- ...output,
2040
- body: await parseBody(output.body, context),
2041
- };
2042
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2043
- let errorCode: string = "UnknownError";
2044
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2045
- switch (errorCode) {
2046
- case "ResourceNotFoundException":
2047
- case "com.amazonaws.mgn#ResourceNotFoundException":
2048
- response = {
2049
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2050
- name: errorCode,
2051
- $metadata: deserializeMetadata(output),
2052
- };
2053
- break;
2054
- case "UninitializedAccountException":
2055
- case "com.amazonaws.mgn#UninitializedAccountException":
2056
- response = {
2057
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2058
- name: errorCode,
2059
- $metadata: deserializeMetadata(output),
2060
- };
2061
- break;
2062
- default:
2063
- const parsedBody = parsedOutput.body;
2064
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2065
- response = {
2066
- ...parsedBody,
2067
- name: `${errorCode}`,
2068
- message: parsedBody.message || parsedBody.Message || errorCode,
2069
- $fault: "client",
2070
- $metadata: deserializeMetadata(output),
2071
- } as any;
2072
- }
2073
- const message = response.message || response.Message || errorCode;
2074
- response.message = message;
2075
- delete response.Message;
2076
- return Promise.reject(Object.assign(new Error(message), response));
2077
- };
2078
-
2079
- export const deserializeAws_restJson1InitializeServiceCommand = async (
2080
- output: __HttpResponse,
2081
- context: __SerdeContext
2082
- ): Promise<InitializeServiceCommandOutput> => {
2083
- if (output.statusCode !== 204 && output.statusCode >= 300) {
2084
- return deserializeAws_restJson1InitializeServiceCommandError(output, context);
2085
- }
2086
- const contents: InitializeServiceCommandOutput = {
2087
- $metadata: deserializeMetadata(output),
2088
- };
2089
- await collectBody(output.body, context);
2090
- return Promise.resolve(contents);
2091
- };
2092
-
2093
- const deserializeAws_restJson1InitializeServiceCommandError = async (
2094
- output: __HttpResponse,
2095
- context: __SerdeContext
2096
- ): Promise<InitializeServiceCommandOutput> => {
2097
- const parsedOutput: any = {
2098
- ...output,
2099
- body: await parseBody(output.body, context),
2100
- };
2101
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2102
- let errorCode: string = "UnknownError";
2103
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2104
- switch (errorCode) {
2105
- case "AccessDeniedException":
2106
- case "com.amazonaws.mgn#AccessDeniedException":
2107
- response = {
2108
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2109
- name: errorCode,
2110
- $metadata: deserializeMetadata(output),
2111
- };
2112
- break;
2113
- case "ValidationException":
2114
- case "com.amazonaws.mgn#ValidationException":
2115
- response = {
2116
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2117
- name: errorCode,
2118
- $metadata: deserializeMetadata(output),
2119
- };
2120
- break;
2121
- default:
2122
- const parsedBody = parsedOutput.body;
2123
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2124
- response = {
2125
- ...parsedBody,
2126
- name: `${errorCode}`,
2127
- message: parsedBody.message || parsedBody.Message || errorCode,
2128
- $fault: "client",
2129
- $metadata: deserializeMetadata(output),
2130
- } as any;
2131
- }
2132
- const message = response.message || response.Message || errorCode;
2133
- response.message = message;
2134
- delete response.Message;
2135
- return Promise.reject(Object.assign(new Error(message), response));
2136
- };
2137
-
2138
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (
2139
- output: __HttpResponse,
2140
- context: __SerdeContext
2141
- ): Promise<ListTagsForResourceCommandOutput> => {
2142
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2143
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2144
- }
2145
- const contents: ListTagsForResourceCommandOutput = {
2146
- $metadata: deserializeMetadata(output),
2147
- tags: undefined,
2148
- };
2149
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2150
- if (data.tags !== undefined && data.tags !== null) {
2151
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2152
- }
2153
- return Promise.resolve(contents);
2154
- };
2155
-
2156
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (
2157
- output: __HttpResponse,
2158
- context: __SerdeContext
2159
- ): Promise<ListTagsForResourceCommandOutput> => {
2160
- const parsedOutput: any = {
2161
- ...output,
2162
- body: await parseBody(output.body, context),
2163
- };
2164
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2165
- let errorCode: string = "UnknownError";
2166
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2167
- switch (errorCode) {
2168
- case "AccessDeniedException":
2169
- case "com.amazonaws.mgn#AccessDeniedException":
2170
- response = {
2171
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2172
- name: errorCode,
2173
- $metadata: deserializeMetadata(output),
2174
- };
2175
- break;
2176
- case "InternalServerException":
2177
- case "com.amazonaws.mgn#InternalServerException":
2178
- response = {
2179
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2180
- name: errorCode,
2181
- $metadata: deserializeMetadata(output),
2182
- };
2183
- break;
2184
- case "ResourceNotFoundException":
2185
- case "com.amazonaws.mgn#ResourceNotFoundException":
2186
- response = {
2187
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2188
- name: errorCode,
2189
- $metadata: deserializeMetadata(output),
2190
- };
2191
- break;
2192
- case "ThrottlingException":
2193
- case "com.amazonaws.mgn#ThrottlingException":
2194
- response = {
2195
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2196
- name: errorCode,
2197
- $metadata: deserializeMetadata(output),
2198
- };
2199
- break;
2200
- case "ValidationException":
2201
- case "com.amazonaws.mgn#ValidationException":
2202
- response = {
2203
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2204
- name: errorCode,
2205
- $metadata: deserializeMetadata(output),
2206
- };
2207
- break;
2208
- default:
2209
- const parsedBody = parsedOutput.body;
2210
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2211
- response = {
2212
- ...parsedBody,
2213
- name: `${errorCode}`,
2214
- message: parsedBody.message || parsedBody.Message || errorCode,
2215
- $fault: "client",
2216
- $metadata: deserializeMetadata(output),
2217
- } as any;
2218
- }
2219
- const message = response.message || response.Message || errorCode;
2220
- response.message = message;
2221
- delete response.Message;
2222
- return Promise.reject(Object.assign(new Error(message), response));
2223
- };
2224
-
2225
- export const deserializeAws_restJson1MarkAsArchivedCommand = async (
2226
- output: __HttpResponse,
2227
- context: __SerdeContext
2228
- ): Promise<MarkAsArchivedCommandOutput> => {
2229
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2230
- return deserializeAws_restJson1MarkAsArchivedCommandError(output, context);
2231
- }
2232
- const contents: MarkAsArchivedCommandOutput = {
2233
- $metadata: deserializeMetadata(output),
2234
- arn: undefined,
2235
- dataReplicationInfo: undefined,
2236
- isArchived: undefined,
2237
- launchedInstance: undefined,
2238
- lifeCycle: undefined,
2239
- sourceProperties: undefined,
2240
- sourceServerID: undefined,
2241
- tags: undefined,
2242
- };
2243
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2244
- if (data.arn !== undefined && data.arn !== null) {
2245
- contents.arn = __expectString(data.arn);
2246
- }
2247
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
2248
- contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
2249
- }
2250
- if (data.isArchived !== undefined && data.isArchived !== null) {
2251
- contents.isArchived = __expectBoolean(data.isArchived);
2252
- }
2253
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
2254
- contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
2255
- }
2256
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
2257
- contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
2258
- }
2259
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
2260
- contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
2261
- }
2262
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2263
- contents.sourceServerID = __expectString(data.sourceServerID);
2264
- }
2265
- if (data.tags !== undefined && data.tags !== null) {
2266
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2267
- }
2268
- return Promise.resolve(contents);
2269
- };
2270
-
2271
- const deserializeAws_restJson1MarkAsArchivedCommandError = async (
2272
- output: __HttpResponse,
2273
- context: __SerdeContext
2274
- ): Promise<MarkAsArchivedCommandOutput> => {
2275
- const parsedOutput: any = {
2276
- ...output,
2277
- body: await parseBody(output.body, context),
2278
- };
2279
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2280
- let errorCode: string = "UnknownError";
2281
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2282
- switch (errorCode) {
2283
- case "ConflictException":
2284
- case "com.amazonaws.mgn#ConflictException":
2285
- response = {
2286
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2287
- name: errorCode,
2288
- $metadata: deserializeMetadata(output),
2289
- };
2290
- break;
2291
- case "ResourceNotFoundException":
2292
- case "com.amazonaws.mgn#ResourceNotFoundException":
2293
- response = {
2294
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2295
- name: errorCode,
2296
- $metadata: deserializeMetadata(output),
2297
- };
2298
- break;
2299
- case "UninitializedAccountException":
2300
- case "com.amazonaws.mgn#UninitializedAccountException":
2301
- response = {
2302
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2303
- name: errorCode,
2304
- $metadata: deserializeMetadata(output),
2305
- };
2306
- break;
2307
- default:
2308
- const parsedBody = parsedOutput.body;
2309
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2310
- response = {
2311
- ...parsedBody,
2312
- name: `${errorCode}`,
2313
- message: parsedBody.message || parsedBody.Message || errorCode,
2314
- $fault: "client",
2315
- $metadata: deserializeMetadata(output),
2316
- } as any;
2317
- }
2318
- const message = response.message || response.Message || errorCode;
2319
- response.message = message;
2320
- delete response.Message;
2321
- return Promise.reject(Object.assign(new Error(message), response));
2322
- };
2323
-
2324
- export const deserializeAws_restJson1RetryDataReplicationCommand = async (
2325
- output: __HttpResponse,
2326
- context: __SerdeContext
2327
- ): Promise<RetryDataReplicationCommandOutput> => {
2328
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2329
- return deserializeAws_restJson1RetryDataReplicationCommandError(output, context);
2330
- }
2331
- const contents: RetryDataReplicationCommandOutput = {
2332
- $metadata: deserializeMetadata(output),
2333
- arn: undefined,
2334
- dataReplicationInfo: undefined,
2335
- isArchived: undefined,
2336
- launchedInstance: undefined,
2337
- lifeCycle: undefined,
2338
- sourceProperties: undefined,
2339
- sourceServerID: undefined,
2340
- tags: undefined,
2341
- };
2342
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2343
- if (data.arn !== undefined && data.arn !== null) {
2344
- contents.arn = __expectString(data.arn);
2345
- }
2346
- if (data.dataReplicationInfo !== undefined && data.dataReplicationInfo !== null) {
2347
- contents.dataReplicationInfo = deserializeAws_restJson1DataReplicationInfo(data.dataReplicationInfo, context);
2348
- }
2349
- if (data.isArchived !== undefined && data.isArchived !== null) {
2350
- contents.isArchived = __expectBoolean(data.isArchived);
2351
- }
2352
- if (data.launchedInstance !== undefined && data.launchedInstance !== null) {
2353
- contents.launchedInstance = deserializeAws_restJson1LaunchedInstance(data.launchedInstance, context);
2354
- }
2355
- if (data.lifeCycle !== undefined && data.lifeCycle !== null) {
2356
- contents.lifeCycle = deserializeAws_restJson1LifeCycle(data.lifeCycle, context);
2357
- }
2358
- if (data.sourceProperties !== undefined && data.sourceProperties !== null) {
2359
- contents.sourceProperties = deserializeAws_restJson1SourceProperties(data.sourceProperties, context);
2360
- }
2361
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2362
- contents.sourceServerID = __expectString(data.sourceServerID);
2363
- }
2364
- if (data.tags !== undefined && data.tags !== null) {
2365
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
2366
- }
2367
- return Promise.resolve(contents);
2368
- };
2369
-
2370
- const deserializeAws_restJson1RetryDataReplicationCommandError = async (
2371
- output: __HttpResponse,
2372
- context: __SerdeContext
2373
- ): Promise<RetryDataReplicationCommandOutput> => {
2374
- const parsedOutput: any = {
2375
- ...output,
2376
- body: await parseBody(output.body, context),
2377
- };
2378
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2379
- let errorCode: string = "UnknownError";
2380
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2381
- switch (errorCode) {
2382
- case "ResourceNotFoundException":
2383
- case "com.amazonaws.mgn#ResourceNotFoundException":
2384
- response = {
2385
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2386
- name: errorCode,
2387
- $metadata: deserializeMetadata(output),
2388
- };
2389
- break;
2390
- case "UninitializedAccountException":
2391
- case "com.amazonaws.mgn#UninitializedAccountException":
2392
- response = {
2393
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2394
- name: errorCode,
2395
- $metadata: deserializeMetadata(output),
2396
- };
2397
- break;
2398
- case "ValidationException":
2399
- case "com.amazonaws.mgn#ValidationException":
2400
- response = {
2401
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2402
- name: errorCode,
2403
- $metadata: deserializeMetadata(output),
2404
- };
2405
- break;
2406
- default:
2407
- const parsedBody = parsedOutput.body;
2408
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2409
- response = {
2410
- ...parsedBody,
2411
- name: `${errorCode}`,
2412
- message: parsedBody.message || parsedBody.Message || errorCode,
2413
- $fault: "client",
2414
- $metadata: deserializeMetadata(output),
2415
- } as any;
2416
- }
2417
- const message = response.message || response.Message || errorCode;
2418
- response.message = message;
2419
- delete response.Message;
2420
- return Promise.reject(Object.assign(new Error(message), response));
2421
- };
2422
-
2423
- export const deserializeAws_restJson1StartCutoverCommand = async (
2424
- output: __HttpResponse,
2425
- context: __SerdeContext
2426
- ): Promise<StartCutoverCommandOutput> => {
2427
- if (output.statusCode !== 202 && output.statusCode >= 300) {
2428
- return deserializeAws_restJson1StartCutoverCommandError(output, context);
2429
- }
2430
- const contents: StartCutoverCommandOutput = {
2431
- $metadata: deserializeMetadata(output),
2432
- job: undefined,
2433
- };
2434
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2435
- if (data.job !== undefined && data.job !== null) {
2436
- contents.job = deserializeAws_restJson1Job(data.job, context);
2437
- }
2438
- return Promise.resolve(contents);
2439
- };
2440
-
2441
- const deserializeAws_restJson1StartCutoverCommandError = async (
2442
- output: __HttpResponse,
2443
- context: __SerdeContext
2444
- ): Promise<StartCutoverCommandOutput> => {
2445
- const parsedOutput: any = {
2446
- ...output,
2447
- body: await parseBody(output.body, context),
2448
- };
2449
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2450
- let errorCode: string = "UnknownError";
2451
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2452
- switch (errorCode) {
2453
- case "ConflictException":
2454
- case "com.amazonaws.mgn#ConflictException":
2455
- response = {
2456
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2457
- name: errorCode,
2458
- $metadata: deserializeMetadata(output),
2459
- };
2460
- break;
2461
- case "UninitializedAccountException":
2462
- case "com.amazonaws.mgn#UninitializedAccountException":
2463
- response = {
2464
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2465
- name: errorCode,
2466
- $metadata: deserializeMetadata(output),
2467
- };
2468
- break;
2469
- case "ValidationException":
2470
- case "com.amazonaws.mgn#ValidationException":
2471
- response = {
2472
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2473
- name: errorCode,
2474
- $metadata: deserializeMetadata(output),
2475
- };
2476
- break;
2477
- default:
2478
- const parsedBody = parsedOutput.body;
2479
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2480
- response = {
2481
- ...parsedBody,
2482
- name: `${errorCode}`,
2483
- message: parsedBody.message || parsedBody.Message || errorCode,
2484
- $fault: "client",
2485
- $metadata: deserializeMetadata(output),
2486
- } as any;
2487
- }
2488
- const message = response.message || response.Message || errorCode;
2489
- response.message = message;
2490
- delete response.Message;
2491
- return Promise.reject(Object.assign(new Error(message), response));
2492
- };
2493
-
2494
- export const deserializeAws_restJson1StartTestCommand = async (
2495
- output: __HttpResponse,
2496
- context: __SerdeContext
2497
- ): Promise<StartTestCommandOutput> => {
2498
- if (output.statusCode !== 202 && output.statusCode >= 300) {
2499
- return deserializeAws_restJson1StartTestCommandError(output, context);
2500
- }
2501
- const contents: StartTestCommandOutput = {
2502
- $metadata: deserializeMetadata(output),
2503
- job: undefined,
2504
- };
2505
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2506
- if (data.job !== undefined && data.job !== null) {
2507
- contents.job = deserializeAws_restJson1Job(data.job, context);
2508
- }
2509
- return Promise.resolve(contents);
2510
- };
2511
-
2512
- const deserializeAws_restJson1StartTestCommandError = async (
2513
- output: __HttpResponse,
2514
- context: __SerdeContext
2515
- ): Promise<StartTestCommandOutput> => {
2516
- const parsedOutput: any = {
2517
- ...output,
2518
- body: await parseBody(output.body, context),
2519
- };
2520
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2521
- let errorCode: string = "UnknownError";
2522
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2523
- switch (errorCode) {
2524
- case "ConflictException":
2525
- case "com.amazonaws.mgn#ConflictException":
2526
- response = {
2527
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2528
- name: errorCode,
2529
- $metadata: deserializeMetadata(output),
2530
- };
2531
- break;
2532
- case "UninitializedAccountException":
2533
- case "com.amazonaws.mgn#UninitializedAccountException":
2534
- response = {
2535
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2536
- name: errorCode,
2537
- $metadata: deserializeMetadata(output),
2538
- };
2539
- break;
2540
- case "ValidationException":
2541
- case "com.amazonaws.mgn#ValidationException":
2542
- response = {
2543
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2544
- name: errorCode,
2545
- $metadata: deserializeMetadata(output),
2546
- };
2547
- break;
2548
- default:
2549
- const parsedBody = parsedOutput.body;
2550
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2551
- response = {
2552
- ...parsedBody,
2553
- name: `${errorCode}`,
2554
- message: parsedBody.message || parsedBody.Message || errorCode,
2555
- $fault: "client",
2556
- $metadata: deserializeMetadata(output),
2557
- } as any;
2558
- }
2559
- const message = response.message || response.Message || errorCode;
2560
- response.message = message;
2561
- delete response.Message;
2562
- return Promise.reject(Object.assign(new Error(message), response));
2563
- };
2564
-
2565
- export const deserializeAws_restJson1TagResourceCommand = async (
2566
- output: __HttpResponse,
2567
- context: __SerdeContext
2568
- ): Promise<TagResourceCommandOutput> => {
2569
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2570
- return deserializeAws_restJson1TagResourceCommandError(output, context);
2571
- }
2572
- const contents: TagResourceCommandOutput = {
2573
- $metadata: deserializeMetadata(output),
2574
- };
2575
- await collectBody(output.body, context);
2576
- return Promise.resolve(contents);
2577
- };
2578
-
2579
- const deserializeAws_restJson1TagResourceCommandError = async (
2580
- output: __HttpResponse,
2581
- context: __SerdeContext
2582
- ): Promise<TagResourceCommandOutput> => {
2583
- const parsedOutput: any = {
2584
- ...output,
2585
- body: await parseBody(output.body, context),
2586
- };
2587
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2588
- let errorCode: string = "UnknownError";
2589
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2590
- switch (errorCode) {
2591
- case "AccessDeniedException":
2592
- case "com.amazonaws.mgn#AccessDeniedException":
2593
- response = {
2594
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2595
- name: errorCode,
2596
- $metadata: deserializeMetadata(output),
2597
- };
2598
- break;
2599
- case "InternalServerException":
2600
- case "com.amazonaws.mgn#InternalServerException":
2601
- response = {
2602
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2603
- name: errorCode,
2604
- $metadata: deserializeMetadata(output),
2605
- };
2606
- break;
2607
- case "ResourceNotFoundException":
2608
- case "com.amazonaws.mgn#ResourceNotFoundException":
2609
- response = {
2610
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2611
- name: errorCode,
2612
- $metadata: deserializeMetadata(output),
2613
- };
2614
- break;
2615
- case "ThrottlingException":
2616
- case "com.amazonaws.mgn#ThrottlingException":
2617
- response = {
2618
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2619
- name: errorCode,
2620
- $metadata: deserializeMetadata(output),
2621
- };
2622
- break;
2623
- case "ValidationException":
2624
- case "com.amazonaws.mgn#ValidationException":
2625
- response = {
2626
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2627
- name: errorCode,
2628
- $metadata: deserializeMetadata(output),
2629
- };
2630
- break;
2631
- default:
2632
- const parsedBody = parsedOutput.body;
2633
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2634
- response = {
2635
- ...parsedBody,
2636
- name: `${errorCode}`,
2637
- message: parsedBody.message || parsedBody.Message || errorCode,
2638
- $fault: "client",
2639
- $metadata: deserializeMetadata(output),
2640
- } as any;
2641
- }
2642
- const message = response.message || response.Message || errorCode;
2643
- response.message = message;
2644
- delete response.Message;
2645
- return Promise.reject(Object.assign(new Error(message), response));
2646
- };
2647
-
2648
- export const deserializeAws_restJson1TerminateTargetInstancesCommand = async (
2649
- output: __HttpResponse,
2650
- context: __SerdeContext
2651
- ): Promise<TerminateTargetInstancesCommandOutput> => {
2652
- if (output.statusCode !== 202 && output.statusCode >= 300) {
2653
- return deserializeAws_restJson1TerminateTargetInstancesCommandError(output, context);
2654
- }
2655
- const contents: TerminateTargetInstancesCommandOutput = {
2656
- $metadata: deserializeMetadata(output),
2657
- job: undefined,
2658
- };
2659
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2660
- if (data.job !== undefined && data.job !== null) {
2661
- contents.job = deserializeAws_restJson1Job(data.job, context);
2662
- }
2663
- return Promise.resolve(contents);
2664
- };
2665
-
2666
- const deserializeAws_restJson1TerminateTargetInstancesCommandError = async (
2667
- output: __HttpResponse,
2668
- context: __SerdeContext
2669
- ): Promise<TerminateTargetInstancesCommandOutput> => {
2670
- const parsedOutput: any = {
2671
- ...output,
2672
- body: await parseBody(output.body, context),
2673
- };
2674
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2675
- let errorCode: string = "UnknownError";
2676
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2677
- switch (errorCode) {
2678
- case "ConflictException":
2679
- case "com.amazonaws.mgn#ConflictException":
2680
- response = {
2681
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2682
- name: errorCode,
2683
- $metadata: deserializeMetadata(output),
2684
- };
2685
- break;
2686
- case "UninitializedAccountException":
2687
- case "com.amazonaws.mgn#UninitializedAccountException":
2688
- response = {
2689
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2690
- name: errorCode,
2691
- $metadata: deserializeMetadata(output),
2692
- };
2693
- break;
2694
- case "ValidationException":
2695
- case "com.amazonaws.mgn#ValidationException":
2696
- response = {
2697
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2698
- name: errorCode,
2699
- $metadata: deserializeMetadata(output),
2700
- };
2701
- break;
2702
- default:
2703
- const parsedBody = parsedOutput.body;
2704
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2705
- response = {
2706
- ...parsedBody,
2707
- name: `${errorCode}`,
2708
- message: parsedBody.message || parsedBody.Message || errorCode,
2709
- $fault: "client",
2710
- $metadata: deserializeMetadata(output),
2711
- } as any;
2712
- }
2713
- const message = response.message || response.Message || errorCode;
2714
- response.message = message;
2715
- delete response.Message;
2716
- return Promise.reject(Object.assign(new Error(message), response));
2717
- };
2718
-
2719
- export const deserializeAws_restJson1UntagResourceCommand = async (
2720
- output: __HttpResponse,
2721
- context: __SerdeContext
2722
- ): Promise<UntagResourceCommandOutput> => {
2723
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2724
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
2725
- }
2726
- const contents: UntagResourceCommandOutput = {
2727
- $metadata: deserializeMetadata(output),
2728
- };
2729
- await collectBody(output.body, context);
2730
- return Promise.resolve(contents);
2731
- };
2732
-
2733
- const deserializeAws_restJson1UntagResourceCommandError = async (
2734
- output: __HttpResponse,
2735
- context: __SerdeContext
2736
- ): Promise<UntagResourceCommandOutput> => {
2737
- const parsedOutput: any = {
2738
- ...output,
2739
- body: await parseBody(output.body, context),
2740
- };
2741
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2742
- let errorCode: string = "UnknownError";
2743
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2744
- switch (errorCode) {
2745
- case "AccessDeniedException":
2746
- case "com.amazonaws.mgn#AccessDeniedException":
2747
- response = {
2748
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2749
- name: errorCode,
2750
- $metadata: deserializeMetadata(output),
2751
- };
2752
- break;
2753
- case "InternalServerException":
2754
- case "com.amazonaws.mgn#InternalServerException":
2755
- response = {
2756
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2757
- name: errorCode,
2758
- $metadata: deserializeMetadata(output),
2759
- };
2760
- break;
2761
- case "ResourceNotFoundException":
2762
- case "com.amazonaws.mgn#ResourceNotFoundException":
2763
- response = {
2764
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2765
- name: errorCode,
2766
- $metadata: deserializeMetadata(output),
2767
- };
2768
- break;
2769
- case "ThrottlingException":
2770
- case "com.amazonaws.mgn#ThrottlingException":
2771
- response = {
2772
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2773
- name: errorCode,
2774
- $metadata: deserializeMetadata(output),
2775
- };
2776
- break;
2777
- case "ValidationException":
2778
- case "com.amazonaws.mgn#ValidationException":
2779
- response = {
2780
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2781
- name: errorCode,
2782
- $metadata: deserializeMetadata(output),
2783
- };
2784
- break;
2785
- default:
2786
- const parsedBody = parsedOutput.body;
2787
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2788
- response = {
2789
- ...parsedBody,
2790
- name: `${errorCode}`,
2791
- message: parsedBody.message || parsedBody.Message || errorCode,
2792
- $fault: "client",
2793
- $metadata: deserializeMetadata(output),
2794
- } as any;
2795
- }
2796
- const message = response.message || response.Message || errorCode;
2797
- response.message = message;
2798
- delete response.Message;
2799
- return Promise.reject(Object.assign(new Error(message), response));
2800
- };
2801
-
2802
- export const deserializeAws_restJson1UpdateLaunchConfigurationCommand = async (
2803
- output: __HttpResponse,
2804
- context: __SerdeContext
2805
- ): Promise<UpdateLaunchConfigurationCommandOutput> => {
2806
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2807
- return deserializeAws_restJson1UpdateLaunchConfigurationCommandError(output, context);
2808
- }
2809
- const contents: UpdateLaunchConfigurationCommandOutput = {
2810
- $metadata: deserializeMetadata(output),
2811
- copyPrivateIp: undefined,
2812
- copyTags: undefined,
2813
- ec2LaunchTemplateID: undefined,
2814
- launchDisposition: undefined,
2815
- licensing: undefined,
2816
- name: undefined,
2817
- sourceServerID: undefined,
2818
- targetInstanceTypeRightSizingMethod: undefined,
2819
- };
2820
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2821
- if (data.copyPrivateIp !== undefined && data.copyPrivateIp !== null) {
2822
- contents.copyPrivateIp = __expectBoolean(data.copyPrivateIp);
2823
- }
2824
- if (data.copyTags !== undefined && data.copyTags !== null) {
2825
- contents.copyTags = __expectBoolean(data.copyTags);
2826
- }
2827
- if (data.ec2LaunchTemplateID !== undefined && data.ec2LaunchTemplateID !== null) {
2828
- contents.ec2LaunchTemplateID = __expectString(data.ec2LaunchTemplateID);
2829
- }
2830
- if (data.launchDisposition !== undefined && data.launchDisposition !== null) {
2831
- contents.launchDisposition = __expectString(data.launchDisposition);
2832
- }
2833
- if (data.licensing !== undefined && data.licensing !== null) {
2834
- contents.licensing = deserializeAws_restJson1Licensing(data.licensing, context);
2835
- }
2836
- if (data.name !== undefined && data.name !== null) {
2837
- contents.name = __expectString(data.name);
2838
- }
2839
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2840
- contents.sourceServerID = __expectString(data.sourceServerID);
2841
- }
2842
- if (data.targetInstanceTypeRightSizingMethod !== undefined && data.targetInstanceTypeRightSizingMethod !== null) {
2843
- contents.targetInstanceTypeRightSizingMethod = __expectString(data.targetInstanceTypeRightSizingMethod);
2844
- }
2845
- return Promise.resolve(contents);
2846
- };
2847
-
2848
- const deserializeAws_restJson1UpdateLaunchConfigurationCommandError = async (
2849
- output: __HttpResponse,
2850
- context: __SerdeContext
2851
- ): Promise<UpdateLaunchConfigurationCommandOutput> => {
2852
- const parsedOutput: any = {
2853
- ...output,
2854
- body: await parseBody(output.body, context),
2855
- };
2856
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2857
- let errorCode: string = "UnknownError";
2858
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2859
- switch (errorCode) {
2860
- case "ConflictException":
2861
- case "com.amazonaws.mgn#ConflictException":
2862
- response = {
2863
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2864
- name: errorCode,
2865
- $metadata: deserializeMetadata(output),
2866
- };
2867
- break;
2868
- case "ResourceNotFoundException":
2869
- case "com.amazonaws.mgn#ResourceNotFoundException":
2870
- response = {
2871
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2872
- name: errorCode,
2873
- $metadata: deserializeMetadata(output),
2874
- };
2875
- break;
2876
- case "UninitializedAccountException":
2877
- case "com.amazonaws.mgn#UninitializedAccountException":
2878
- response = {
2879
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
2880
- name: errorCode,
2881
- $metadata: deserializeMetadata(output),
2882
- };
2883
- break;
2884
- case "ValidationException":
2885
- case "com.amazonaws.mgn#ValidationException":
2886
- response = {
2887
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2888
- name: errorCode,
2889
- $metadata: deserializeMetadata(output),
2890
- };
2891
- break;
2892
- default:
2893
- const parsedBody = parsedOutput.body;
2894
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2895
- response = {
2896
- ...parsedBody,
2897
- name: `${errorCode}`,
2898
- message: parsedBody.message || parsedBody.Message || errorCode,
2899
- $fault: "client",
2900
- $metadata: deserializeMetadata(output),
2901
- } as any;
2902
- }
2903
- const message = response.message || response.Message || errorCode;
2904
- response.message = message;
2905
- delete response.Message;
2906
- return Promise.reject(Object.assign(new Error(message), response));
2907
- };
2908
-
2909
- export const deserializeAws_restJson1UpdateReplicationConfigurationCommand = async (
2910
- output: __HttpResponse,
2911
- context: __SerdeContext
2912
- ): Promise<UpdateReplicationConfigurationCommandOutput> => {
2913
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2914
- return deserializeAws_restJson1UpdateReplicationConfigurationCommandError(output, context);
2915
- }
2916
- const contents: UpdateReplicationConfigurationCommandOutput = {
2917
- $metadata: deserializeMetadata(output),
2918
- associateDefaultSecurityGroup: undefined,
2919
- bandwidthThrottling: undefined,
2920
- createPublicIP: undefined,
2921
- dataPlaneRouting: undefined,
2922
- defaultLargeStagingDiskType: undefined,
2923
- ebsEncryption: undefined,
2924
- ebsEncryptionKeyArn: undefined,
2925
- name: undefined,
2926
- replicatedDisks: undefined,
2927
- replicationServerInstanceType: undefined,
2928
- replicationServersSecurityGroupsIDs: undefined,
2929
- sourceServerID: undefined,
2930
- stagingAreaSubnetId: undefined,
2931
- stagingAreaTags: undefined,
2932
- useDedicatedReplicationServer: undefined,
2933
- };
2934
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2935
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
2936
- contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
2937
- }
2938
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
2939
- contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
2940
- }
2941
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
2942
- contents.createPublicIP = __expectBoolean(data.createPublicIP);
2943
- }
2944
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
2945
- contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
2946
- }
2947
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
2948
- contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
2949
- }
2950
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
2951
- contents.ebsEncryption = __expectString(data.ebsEncryption);
2952
- }
2953
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
2954
- contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
2955
- }
2956
- if (data.name !== undefined && data.name !== null) {
2957
- contents.name = __expectString(data.name);
2958
- }
2959
- if (data.replicatedDisks !== undefined && data.replicatedDisks !== null) {
2960
- contents.replicatedDisks = deserializeAws_restJson1ReplicationConfigurationReplicatedDisks(
2961
- data.replicatedDisks,
2962
- context
2963
- );
2964
- }
2965
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
2966
- contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
2967
- }
2968
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
2969
- contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(
2970
- data.replicationServersSecurityGroupsIDs,
2971
- context
2972
- );
2973
- }
2974
- if (data.sourceServerID !== undefined && data.sourceServerID !== null) {
2975
- contents.sourceServerID = __expectString(data.sourceServerID);
2976
- }
2977
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
2978
- contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
2979
- }
2980
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
2981
- contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
2982
- }
2983
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
2984
- contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
2985
- }
2986
- return Promise.resolve(contents);
2987
- };
2988
-
2989
- const deserializeAws_restJson1UpdateReplicationConfigurationCommandError = async (
2990
- output: __HttpResponse,
2991
- context: __SerdeContext
2992
- ): Promise<UpdateReplicationConfigurationCommandOutput> => {
2993
- const parsedOutput: any = {
2994
- ...output,
2995
- body: await parseBody(output.body, context),
2996
- };
2997
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2998
- let errorCode: string = "UnknownError";
2999
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3000
- switch (errorCode) {
3001
- case "AccessDeniedException":
3002
- case "com.amazonaws.mgn#AccessDeniedException":
3003
- response = {
3004
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3005
- name: errorCode,
3006
- $metadata: deserializeMetadata(output),
3007
- };
3008
- break;
3009
- case "ConflictException":
3010
- case "com.amazonaws.mgn#ConflictException":
3011
- response = {
3012
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
3013
- name: errorCode,
3014
- $metadata: deserializeMetadata(output),
3015
- };
3016
- break;
3017
- case "ResourceNotFoundException":
3018
- case "com.amazonaws.mgn#ResourceNotFoundException":
3019
- response = {
3020
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3021
- name: errorCode,
3022
- $metadata: deserializeMetadata(output),
3023
- };
3024
- break;
3025
- case "UninitializedAccountException":
3026
- case "com.amazonaws.mgn#UninitializedAccountException":
3027
- response = {
3028
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
3029
- name: errorCode,
3030
- $metadata: deserializeMetadata(output),
3031
- };
3032
- break;
3033
- case "ValidationException":
3034
- case "com.amazonaws.mgn#ValidationException":
3035
- response = {
3036
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3037
- name: errorCode,
3038
- $metadata: deserializeMetadata(output),
3039
- };
3040
- break;
3041
- default:
3042
- const parsedBody = parsedOutput.body;
3043
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3044
- response = {
3045
- ...parsedBody,
3046
- name: `${errorCode}`,
3047
- message: parsedBody.message || parsedBody.Message || errorCode,
3048
- $fault: "client",
3049
- $metadata: deserializeMetadata(output),
3050
- } as any;
3051
- }
3052
- const message = response.message || response.Message || errorCode;
3053
- response.message = message;
3054
- delete response.Message;
3055
- return Promise.reject(Object.assign(new Error(message), response));
3056
- };
3057
-
3058
- export const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand = async (
3059
- output: __HttpResponse,
3060
- context: __SerdeContext
3061
- ): Promise<UpdateReplicationConfigurationTemplateCommandOutput> => {
3062
- if (output.statusCode !== 200 && output.statusCode >= 300) {
3063
- return deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError(output, context);
3064
- }
3065
- const contents: UpdateReplicationConfigurationTemplateCommandOutput = {
3066
- $metadata: deserializeMetadata(output),
3067
- arn: undefined,
3068
- associateDefaultSecurityGroup: undefined,
3069
- bandwidthThrottling: undefined,
3070
- createPublicIP: undefined,
3071
- dataPlaneRouting: undefined,
3072
- defaultLargeStagingDiskType: undefined,
3073
- ebsEncryption: undefined,
3074
- ebsEncryptionKeyArn: undefined,
3075
- replicationConfigurationTemplateID: undefined,
3076
- replicationServerInstanceType: undefined,
3077
- replicationServersSecurityGroupsIDs: undefined,
3078
- stagingAreaSubnetId: undefined,
3079
- stagingAreaTags: undefined,
3080
- tags: undefined,
3081
- useDedicatedReplicationServer: undefined,
3082
- };
3083
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
3084
- if (data.arn !== undefined && data.arn !== null) {
3085
- contents.arn = __expectString(data.arn);
3086
- }
3087
- if (data.associateDefaultSecurityGroup !== undefined && data.associateDefaultSecurityGroup !== null) {
3088
- contents.associateDefaultSecurityGroup = __expectBoolean(data.associateDefaultSecurityGroup);
3089
- }
3090
- if (data.bandwidthThrottling !== undefined && data.bandwidthThrottling !== null) {
3091
- contents.bandwidthThrottling = __expectLong(data.bandwidthThrottling);
3092
- }
3093
- if (data.createPublicIP !== undefined && data.createPublicIP !== null) {
3094
- contents.createPublicIP = __expectBoolean(data.createPublicIP);
3095
- }
3096
- if (data.dataPlaneRouting !== undefined && data.dataPlaneRouting !== null) {
3097
- contents.dataPlaneRouting = __expectString(data.dataPlaneRouting);
3098
- }
3099
- if (data.defaultLargeStagingDiskType !== undefined && data.defaultLargeStagingDiskType !== null) {
3100
- contents.defaultLargeStagingDiskType = __expectString(data.defaultLargeStagingDiskType);
3101
- }
3102
- if (data.ebsEncryption !== undefined && data.ebsEncryption !== null) {
3103
- contents.ebsEncryption = __expectString(data.ebsEncryption);
3104
- }
3105
- if (data.ebsEncryptionKeyArn !== undefined && data.ebsEncryptionKeyArn !== null) {
3106
- contents.ebsEncryptionKeyArn = __expectString(data.ebsEncryptionKeyArn);
3107
- }
3108
- if (data.replicationConfigurationTemplateID !== undefined && data.replicationConfigurationTemplateID !== null) {
3109
- contents.replicationConfigurationTemplateID = __expectString(data.replicationConfigurationTemplateID);
3110
- }
3111
- if (data.replicationServerInstanceType !== undefined && data.replicationServerInstanceType !== null) {
3112
- contents.replicationServerInstanceType = __expectString(data.replicationServerInstanceType);
3113
- }
3114
- if (data.replicationServersSecurityGroupsIDs !== undefined && data.replicationServersSecurityGroupsIDs !== null) {
3115
- contents.replicationServersSecurityGroupsIDs = deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(
3116
- data.replicationServersSecurityGroupsIDs,
3117
- context
3118
- );
3119
- }
3120
- if (data.stagingAreaSubnetId !== undefined && data.stagingAreaSubnetId !== null) {
3121
- contents.stagingAreaSubnetId = __expectString(data.stagingAreaSubnetId);
3122
- }
3123
- if (data.stagingAreaTags !== undefined && data.stagingAreaTags !== null) {
3124
- contents.stagingAreaTags = deserializeAws_restJson1TagsMap(data.stagingAreaTags, context);
3125
- }
3126
- if (data.tags !== undefined && data.tags !== null) {
3127
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
3128
- }
3129
- if (data.useDedicatedReplicationServer !== undefined && data.useDedicatedReplicationServer !== null) {
3130
- contents.useDedicatedReplicationServer = __expectBoolean(data.useDedicatedReplicationServer);
3131
- }
3132
- return Promise.resolve(contents);
3133
- };
3134
-
3135
- const deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError = async (
3136
- output: __HttpResponse,
3137
- context: __SerdeContext
3138
- ): Promise<UpdateReplicationConfigurationTemplateCommandOutput> => {
3139
- const parsedOutput: any = {
3140
- ...output,
3141
- body: await parseBody(output.body, context),
3142
- };
3143
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
3144
- let errorCode: string = "UnknownError";
3145
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3146
- switch (errorCode) {
3147
- case "AccessDeniedException":
3148
- case "com.amazonaws.mgn#AccessDeniedException":
3149
- response = {
3150
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3151
- name: errorCode,
3152
- $metadata: deserializeMetadata(output),
3153
- };
3154
- break;
3155
- case "ResourceNotFoundException":
3156
- case "com.amazonaws.mgn#ResourceNotFoundException":
3157
- response = {
3158
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3159
- name: errorCode,
3160
- $metadata: deserializeMetadata(output),
3161
- };
3162
- break;
3163
- case "UninitializedAccountException":
3164
- case "com.amazonaws.mgn#UninitializedAccountException":
3165
- response = {
3166
- ...(await deserializeAws_restJson1UninitializedAccountExceptionResponse(parsedOutput, context)),
3167
- name: errorCode,
3168
- $metadata: deserializeMetadata(output),
3169
- };
3170
- break;
3171
- case "ValidationException":
3172
- case "com.amazonaws.mgn#ValidationException":
3173
- response = {
3174
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3175
- name: errorCode,
3176
- $metadata: deserializeMetadata(output),
3177
- };
3178
- break;
3179
- default:
3180
- const parsedBody = parsedOutput.body;
3181
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3182
- response = {
3183
- ...parsedBody,
3184
- name: `${errorCode}`,
3185
- message: parsedBody.message || parsedBody.Message || errorCode,
3186
- $fault: "client",
3187
- $metadata: deserializeMetadata(output),
3188
- } as any;
3189
- }
3190
- const message = response.message || response.Message || errorCode;
3191
- response.message = message;
3192
- delete response.Message;
3193
- return Promise.reject(Object.assign(new Error(message), response));
3194
- };
3195
-
3196
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
3197
- parsedOutput: any,
3198
- context: __SerdeContext
3199
- ): Promise<AccessDeniedException> => {
3200
- const contents: AccessDeniedException = {
3201
- name: "AccessDeniedException",
3202
- $fault: "client",
3203
- $metadata: deserializeMetadata(parsedOutput),
3204
- code: undefined,
3205
- message: undefined,
3206
- };
3207
- const data: any = parsedOutput.body;
3208
- if (data.code !== undefined && data.code !== null) {
3209
- contents.code = __expectString(data.code);
3210
- }
3211
- if (data.message !== undefined && data.message !== null) {
3212
- contents.message = __expectString(data.message);
3213
- }
3214
- return contents;
3215
- };
3216
-
3217
- const deserializeAws_restJson1ConflictExceptionResponse = async (
3218
- parsedOutput: any,
3219
- context: __SerdeContext
3220
- ): Promise<ConflictException> => {
3221
- const contents: ConflictException = {
3222
- name: "ConflictException",
3223
- $fault: "client",
3224
- $metadata: deserializeMetadata(parsedOutput),
3225
- code: undefined,
3226
- message: undefined,
3227
- resourceId: undefined,
3228
- resourceType: undefined,
3229
- };
3230
- const data: any = parsedOutput.body;
3231
- if (data.code !== undefined && data.code !== null) {
3232
- contents.code = __expectString(data.code);
3233
- }
3234
- if (data.message !== undefined && data.message !== null) {
3235
- contents.message = __expectString(data.message);
3236
- }
3237
- if (data.resourceId !== undefined && data.resourceId !== null) {
3238
- contents.resourceId = __expectString(data.resourceId);
3239
- }
3240
- if (data.resourceType !== undefined && data.resourceType !== null) {
3241
- contents.resourceType = __expectString(data.resourceType);
3242
- }
3243
- return contents;
3244
- };
3245
-
3246
- const deserializeAws_restJson1InternalServerExceptionResponse = async (
3247
- parsedOutput: any,
3248
- context: __SerdeContext
3249
- ): Promise<InternalServerException> => {
3250
- const contents: InternalServerException = {
3251
- name: "InternalServerException",
3252
- $fault: "server",
3253
- $metadata: deserializeMetadata(parsedOutput),
3254
- message: undefined,
3255
- retryAfterSeconds: undefined,
3256
- };
3257
- if (parsedOutput.headers["retry-after"] !== undefined) {
3258
- contents.retryAfterSeconds = __strictParseLong(parsedOutput.headers["retry-after"]);
3259
- }
3260
- const data: any = parsedOutput.body;
3261
- if (data.message !== undefined && data.message !== null) {
3262
- contents.message = __expectString(data.message);
3263
- }
3264
- return contents;
3265
- };
3266
-
3267
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
3268
- parsedOutput: any,
3269
- context: __SerdeContext
3270
- ): Promise<ResourceNotFoundException> => {
3271
- const contents: ResourceNotFoundException = {
3272
- name: "ResourceNotFoundException",
3273
- $fault: "client",
3274
- $metadata: deserializeMetadata(parsedOutput),
3275
- code: undefined,
3276
- message: undefined,
3277
- resourceId: undefined,
3278
- resourceType: undefined,
3279
- };
3280
- const data: any = parsedOutput.body;
3281
- if (data.code !== undefined && data.code !== null) {
3282
- contents.code = __expectString(data.code);
3283
- }
3284
- if (data.message !== undefined && data.message !== null) {
3285
- contents.message = __expectString(data.message);
3286
- }
3287
- if (data.resourceId !== undefined && data.resourceId !== null) {
3288
- contents.resourceId = __expectString(data.resourceId);
3289
- }
3290
- if (data.resourceType !== undefined && data.resourceType !== null) {
3291
- contents.resourceType = __expectString(data.resourceType);
3292
- }
3293
- return contents;
3294
- };
3295
-
3296
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (
3297
- parsedOutput: any,
3298
- context: __SerdeContext
3299
- ): Promise<ThrottlingException> => {
3300
- const contents: ThrottlingException = {
3301
- name: "ThrottlingException",
3302
- $fault: "client",
3303
- $metadata: deserializeMetadata(parsedOutput),
3304
- message: undefined,
3305
- quotaCode: undefined,
3306
- retryAfterSeconds: undefined,
3307
- serviceCode: undefined,
3308
- };
3309
- if (parsedOutput.headers["retry-after"] !== undefined) {
3310
- contents.retryAfterSeconds = parsedOutput.headers["retry-after"];
3311
- }
3312
- const data: any = parsedOutput.body;
3313
- if (data.message !== undefined && data.message !== null) {
3314
- contents.message = __expectString(data.message);
3315
- }
3316
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
3317
- contents.quotaCode = __expectString(data.quotaCode);
3318
- }
3319
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
3320
- contents.serviceCode = __expectString(data.serviceCode);
3321
- }
3322
- return contents;
3323
- };
3324
-
3325
- const deserializeAws_restJson1UninitializedAccountExceptionResponse = async (
3326
- parsedOutput: any,
3327
- context: __SerdeContext
3328
- ): Promise<UninitializedAccountException> => {
3329
- const contents: UninitializedAccountException = {
3330
- name: "UninitializedAccountException",
3331
- $fault: "client",
3332
- $metadata: deserializeMetadata(parsedOutput),
3333
- code: undefined,
3334
- message: undefined,
3335
- };
3336
- const data: any = parsedOutput.body;
3337
- if (data.code !== undefined && data.code !== null) {
3338
- contents.code = __expectString(data.code);
3339
- }
3340
- if (data.message !== undefined && data.message !== null) {
3341
- contents.message = __expectString(data.message);
3342
- }
3343
- return contents;
3344
- };
3345
-
3346
- const deserializeAws_restJson1ValidationExceptionResponse = async (
3347
- parsedOutput: any,
3348
- context: __SerdeContext
3349
- ): Promise<ValidationException> => {
3350
- const contents: ValidationException = {
3351
- name: "ValidationException",
3352
- $fault: "client",
3353
- $metadata: deserializeMetadata(parsedOutput),
3354
- code: undefined,
3355
- fieldList: undefined,
3356
- message: undefined,
3357
- reason: undefined,
3358
- };
3359
- const data: any = parsedOutput.body;
3360
- if (data.code !== undefined && data.code !== null) {
3361
- contents.code = __expectString(data.code);
3362
- }
3363
- if (data.fieldList !== undefined && data.fieldList !== null) {
3364
- contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
3365
- }
3366
- if (data.message !== undefined && data.message !== null) {
3367
- contents.message = __expectString(data.message);
3368
- }
3369
- if (data.reason !== undefined && data.reason !== null) {
3370
- contents.reason = __expectString(data.reason);
3371
- }
3372
- return contents;
3373
- };
3374
-
3375
- const serializeAws_restJson1ChangeServerLifeCycleStateSourceServerLifecycle = (
3376
- input: ChangeServerLifeCycleStateSourceServerLifecycle,
3377
- context: __SerdeContext
3378
- ): any => {
3379
- return {
3380
- ...(input.state !== undefined && input.state !== null && { state: input.state }),
3381
- };
3382
- };
3383
-
3384
- const serializeAws_restJson1DescribeJobsRequestFilters = (
3385
- input: DescribeJobsRequestFilters,
3386
- context: __SerdeContext
3387
- ): any => {
3388
- return {
3389
- ...(input.fromDate !== undefined && input.fromDate !== null && { fromDate: input.fromDate }),
3390
- ...(input.jobIDs !== undefined &&
3391
- input.jobIDs !== null && {
3392
- jobIDs: serializeAws_restJson1DescribeJobsRequestFiltersJobIDs(input.jobIDs, context),
3393
- }),
3394
- ...(input.toDate !== undefined && input.toDate !== null && { toDate: input.toDate }),
3395
- };
3396
- };
3397
-
3398
- const serializeAws_restJson1DescribeJobsRequestFiltersJobIDs = (input: string[], context: __SerdeContext): any => {
3399
- return input
3400
- .filter((e: any) => e != null)
3401
- .map((entry) => {
3402
- if (entry === null) {
3403
- return null as any;
3404
- }
3405
- return entry;
3406
- });
3407
- };
3408
-
3409
- const serializeAws_restJson1DescribeSourceServersRequestFilters = (
3410
- input: DescribeSourceServersRequestFilters,
3411
- context: __SerdeContext
3412
- ): any => {
3413
- return {
3414
- ...(input.isArchived !== undefined && input.isArchived !== null && { isArchived: input.isArchived }),
3415
- ...(input.sourceServerIDs !== undefined &&
3416
- input.sourceServerIDs !== null && {
3417
- sourceServerIDs: serializeAws_restJson1DescribeSourceServersRequestFiltersIDs(input.sourceServerIDs, context),
3418
- }),
3419
- };
3420
- };
3421
-
3422
- const serializeAws_restJson1DescribeSourceServersRequestFiltersIDs = (
3423
- input: string[],
3424
- context: __SerdeContext
3425
- ): any => {
3426
- return input
3427
- .filter((e: any) => e != null)
3428
- .map((entry) => {
3429
- if (entry === null) {
3430
- return null as any;
3431
- }
3432
- return entry;
3433
- });
3434
- };
3435
-
3436
- const serializeAws_restJson1Licensing = (input: Licensing, context: __SerdeContext): any => {
3437
- return {
3438
- ...(input.osByol !== undefined && input.osByol !== null && { osByol: input.osByol }),
3439
- };
3440
- };
3441
-
3442
- const serializeAws_restJson1ReplicationConfigurationReplicatedDisk = (
3443
- input: ReplicationConfigurationReplicatedDisk,
3444
- context: __SerdeContext
3445
- ): any => {
3446
- return {
3447
- ...(input.deviceName !== undefined && input.deviceName !== null && { deviceName: input.deviceName }),
3448
- ...(input.iops !== undefined && input.iops !== null && { iops: input.iops }),
3449
- ...(input.isBootDisk !== undefined && input.isBootDisk !== null && { isBootDisk: input.isBootDisk }),
3450
- ...(input.stagingDiskType !== undefined &&
3451
- input.stagingDiskType !== null && { stagingDiskType: input.stagingDiskType }),
3452
- };
3453
- };
3454
-
3455
- const serializeAws_restJson1ReplicationConfigurationReplicatedDisks = (
3456
- input: ReplicationConfigurationReplicatedDisk[],
3457
- context: __SerdeContext
3458
- ): any => {
3459
- return input
3460
- .filter((e: any) => e != null)
3461
- .map((entry) => {
3462
- if (entry === null) {
3463
- return null as any;
3464
- }
3465
- return serializeAws_restJson1ReplicationConfigurationReplicatedDisk(entry, context);
3466
- });
3467
- };
3468
-
3469
- const serializeAws_restJson1ReplicationConfigurationTemplateIDs = (input: string[], context: __SerdeContext): any => {
3470
- return input
3471
- .filter((e: any) => e != null)
3472
- .map((entry) => {
3473
- if (entry === null) {
3474
- return null as any;
3475
- }
3476
- return entry;
3477
- });
3478
- };
3479
-
3480
- const serializeAws_restJson1ReplicationServersSecurityGroupsIDs = (input: string[], context: __SerdeContext): any => {
3481
- return input
3482
- .filter((e: any) => e != null)
3483
- .map((entry) => {
3484
- if (entry === null) {
3485
- return null as any;
3486
- }
3487
- return entry;
3488
- });
3489
- };
3490
-
3491
- const serializeAws_restJson1StartCutoverRequestSourceServerIDs = (input: string[], context: __SerdeContext): any => {
3492
- return input
3493
- .filter((e: any) => e != null)
3494
- .map((entry) => {
3495
- if (entry === null) {
3496
- return null as any;
3497
- }
3498
- return entry;
3499
- });
3500
- };
3501
-
3502
- const serializeAws_restJson1StartTestRequestSourceServerIDs = (input: string[], context: __SerdeContext): any => {
3503
- return input
3504
- .filter((e: any) => e != null)
3505
- .map((entry) => {
3506
- if (entry === null) {
3507
- return null as any;
3508
- }
3509
- return entry;
3510
- });
3511
- };
3512
-
3513
- const serializeAws_restJson1TagsMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
3514
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
3515
- if (value === null) {
3516
- return acc;
3517
- }
3518
- return {
3519
- ...acc,
3520
- [key]: value,
3521
- };
3522
- }, {});
3523
- };
3524
-
3525
- const serializeAws_restJson1TerminateTargetInstancesRequestSourceServerIDs = (
3526
- input: string[],
3527
- context: __SerdeContext
3528
- ): any => {
3529
- return input
3530
- .filter((e: any) => e != null)
3531
- .map((entry) => {
3532
- if (entry === null) {
3533
- return null as any;
3534
- }
3535
- return entry;
3536
- });
3537
- };
3538
-
3539
- const deserializeAws_restJson1CPU = (output: any, context: __SerdeContext): CPU => {
3540
- return {
3541
- cores: __expectLong(output.cores),
3542
- modelName: __expectString(output.modelName),
3543
- } as any;
3544
- };
3545
-
3546
- const deserializeAws_restJson1Cpus = (output: any, context: __SerdeContext): CPU[] => {
3547
- return (output || [])
3548
- .filter((e: any) => e != null)
3549
- .map((entry: any) => {
3550
- if (entry === null) {
3551
- return null as any;
3552
- }
3553
- return deserializeAws_restJson1CPU(entry, context);
3554
- });
3555
- };
3556
-
3557
- const deserializeAws_restJson1DataReplicationError = (output: any, context: __SerdeContext): DataReplicationError => {
3558
- return {
3559
- error: __expectString(output.error),
3560
- rawError: __expectString(output.rawError),
3561
- } as any;
3562
- };
3563
-
3564
- const deserializeAws_restJson1DataReplicationInfo = (output: any, context: __SerdeContext): DataReplicationInfo => {
3565
- return {
3566
- dataReplicationError:
3567
- output.dataReplicationError !== undefined && output.dataReplicationError !== null
3568
- ? deserializeAws_restJson1DataReplicationError(output.dataReplicationError, context)
3569
- : undefined,
3570
- dataReplicationInitiation:
3571
- output.dataReplicationInitiation !== undefined && output.dataReplicationInitiation !== null
3572
- ? deserializeAws_restJson1DataReplicationInitiation(output.dataReplicationInitiation, context)
3573
- : undefined,
3574
- dataReplicationState: __expectString(output.dataReplicationState),
3575
- etaDateTime: __expectString(output.etaDateTime),
3576
- lagDuration: __expectString(output.lagDuration),
3577
- replicatedDisks:
3578
- output.replicatedDisks !== undefined && output.replicatedDisks !== null
3579
- ? deserializeAws_restJson1DataReplicationInfoReplicatedDisks(output.replicatedDisks, context)
3580
- : undefined,
3581
- } as any;
3582
- };
3583
-
3584
- const deserializeAws_restJson1DataReplicationInfoReplicatedDisk = (
3585
- output: any,
3586
- context: __SerdeContext
3587
- ): DataReplicationInfoReplicatedDisk => {
3588
- return {
3589
- backloggedStorageBytes: __expectLong(output.backloggedStorageBytes),
3590
- deviceName: __expectString(output.deviceName),
3591
- replicatedStorageBytes: __expectLong(output.replicatedStorageBytes),
3592
- rescannedStorageBytes: __expectLong(output.rescannedStorageBytes),
3593
- totalStorageBytes: __expectLong(output.totalStorageBytes),
3594
- } as any;
3595
- };
3596
-
3597
- const deserializeAws_restJson1DataReplicationInfoReplicatedDisks = (
3598
- output: any,
3599
- context: __SerdeContext
3600
- ): DataReplicationInfoReplicatedDisk[] => {
3601
- return (output || [])
3602
- .filter((e: any) => e != null)
3603
- .map((entry: any) => {
3604
- if (entry === null) {
3605
- return null as any;
3606
- }
3607
- return deserializeAws_restJson1DataReplicationInfoReplicatedDisk(entry, context);
3608
- });
3609
- };
3610
-
3611
- const deserializeAws_restJson1DataReplicationInitiation = (
3612
- output: any,
3613
- context: __SerdeContext
3614
- ): DataReplicationInitiation => {
3615
- return {
3616
- nextAttemptDateTime: __expectString(output.nextAttemptDateTime),
3617
- startDateTime: __expectString(output.startDateTime),
3618
- steps:
3619
- output.steps !== undefined && output.steps !== null
3620
- ? deserializeAws_restJson1DataReplicationInitiationSteps(output.steps, context)
3621
- : undefined,
3622
- } as any;
3623
- };
3624
-
3625
- const deserializeAws_restJson1DataReplicationInitiationStep = (
3626
- output: any,
3627
- context: __SerdeContext
3628
- ): DataReplicationInitiationStep => {
3629
- return {
3630
- name: __expectString(output.name),
3631
- status: __expectString(output.status),
3632
- } as any;
3633
- };
3634
-
3635
- const deserializeAws_restJson1DataReplicationInitiationSteps = (
3636
- output: any,
3637
- context: __SerdeContext
3638
- ): DataReplicationInitiationStep[] => {
3639
- return (output || [])
3640
- .filter((e: any) => e != null)
3641
- .map((entry: any) => {
3642
- if (entry === null) {
3643
- return null as any;
3644
- }
3645
- return deserializeAws_restJson1DataReplicationInitiationStep(entry, context);
3646
- });
3647
- };
3648
-
3649
- const deserializeAws_restJson1Disk = (output: any, context: __SerdeContext): Disk => {
3650
- return {
3651
- bytes: __expectLong(output.bytes),
3652
- deviceName: __expectString(output.deviceName),
3653
- } as any;
3654
- };
3655
-
3656
- const deserializeAws_restJson1Disks = (output: any, context: __SerdeContext): Disk[] => {
3657
- return (output || [])
3658
- .filter((e: any) => e != null)
3659
- .map((entry: any) => {
3660
- if (entry === null) {
3661
- return null as any;
3662
- }
3663
- return deserializeAws_restJson1Disk(entry, context);
3664
- });
3665
- };
3666
-
3667
- const deserializeAws_restJson1IdentificationHints = (output: any, context: __SerdeContext): IdentificationHints => {
3668
- return {
3669
- awsInstanceID: __expectString(output.awsInstanceID),
3670
- fqdn: __expectString(output.fqdn),
3671
- hostname: __expectString(output.hostname),
3672
- vmWareUuid: __expectString(output.vmWareUuid),
3673
- } as any;
3674
- };
3675
-
3676
- const deserializeAws_restJson1IPsList = (output: any, context: __SerdeContext): string[] => {
3677
- return (output || [])
3678
- .filter((e: any) => e != null)
3679
- .map((entry: any) => {
3680
- if (entry === null) {
3681
- return null as any;
3682
- }
3683
- return __expectString(entry) as any;
3684
- });
3685
- };
3686
-
3687
- const deserializeAws_restJson1Job = (output: any, context: __SerdeContext): Job => {
3688
- return {
3689
- arn: __expectString(output.arn),
3690
- creationDateTime: __expectString(output.creationDateTime),
3691
- endDateTime: __expectString(output.endDateTime),
3692
- initiatedBy: __expectString(output.initiatedBy),
3693
- jobID: __expectString(output.jobID),
3694
- participatingServers:
3695
- output.participatingServers !== undefined && output.participatingServers !== null
3696
- ? deserializeAws_restJson1ParticipatingServers(output.participatingServers, context)
3697
- : undefined,
3698
- status: __expectString(output.status),
3699
- tags:
3700
- output.tags !== undefined && output.tags !== null
3701
- ? deserializeAws_restJson1TagsMap(output.tags, context)
3702
- : undefined,
3703
- type: __expectString(output.type),
3704
- } as any;
3705
- };
3706
-
3707
- const deserializeAws_restJson1JobLog = (output: any, context: __SerdeContext): JobLog => {
3708
- return {
3709
- event: __expectString(output.event),
3710
- eventData:
3711
- output.eventData !== undefined && output.eventData !== null
3712
- ? deserializeAws_restJson1JobLogEventData(output.eventData, context)
3713
- : undefined,
3714
- logDateTime: __expectString(output.logDateTime),
3715
- } as any;
3716
- };
3717
-
3718
- const deserializeAws_restJson1JobLogEventData = (output: any, context: __SerdeContext): JobLogEventData => {
3719
- return {
3720
- conversionServerID: __expectString(output.conversionServerID),
3721
- rawError: __expectString(output.rawError),
3722
- sourceServerID: __expectString(output.sourceServerID),
3723
- targetInstanceID: __expectString(output.targetInstanceID),
3724
- } as any;
3725
- };
3726
-
3727
- const deserializeAws_restJson1JobLogs = (output: any, context: __SerdeContext): JobLog[] => {
3728
- return (output || [])
3729
- .filter((e: any) => e != null)
3730
- .map((entry: any) => {
3731
- if (entry === null) {
3732
- return null as any;
3733
- }
3734
- return deserializeAws_restJson1JobLog(entry, context);
3735
- });
3736
- };
3737
-
3738
- const deserializeAws_restJson1JobsList = (output: any, context: __SerdeContext): Job[] => {
3739
- return (output || [])
3740
- .filter((e: any) => e != null)
3741
- .map((entry: any) => {
3742
- if (entry === null) {
3743
- return null as any;
3744
- }
3745
- return deserializeAws_restJson1Job(entry, context);
3746
- });
3747
- };
3748
-
3749
- const deserializeAws_restJson1LaunchedInstance = (output: any, context: __SerdeContext): LaunchedInstance => {
3750
- return {
3751
- ec2InstanceID: __expectString(output.ec2InstanceID),
3752
- firstBoot: __expectString(output.firstBoot),
3753
- jobID: __expectString(output.jobID),
3754
- } as any;
3755
- };
3756
-
3757
- const deserializeAws_restJson1Licensing = (output: any, context: __SerdeContext): Licensing => {
3758
- return {
3759
- osByol: __expectBoolean(output.osByol),
3760
- } as any;
3761
- };
3762
-
3763
- const deserializeAws_restJson1LifeCycle = (output: any, context: __SerdeContext): LifeCycle => {
3764
- return {
3765
- addedToServiceDateTime: __expectString(output.addedToServiceDateTime),
3766
- elapsedReplicationDuration: __expectString(output.elapsedReplicationDuration),
3767
- firstByteDateTime: __expectString(output.firstByteDateTime),
3768
- lastCutover:
3769
- output.lastCutover !== undefined && output.lastCutover !== null
3770
- ? deserializeAws_restJson1LifeCycleLastCutover(output.lastCutover, context)
3771
- : undefined,
3772
- lastSeenByServiceDateTime: __expectString(output.lastSeenByServiceDateTime),
3773
- lastTest:
3774
- output.lastTest !== undefined && output.lastTest !== null
3775
- ? deserializeAws_restJson1LifeCycleLastTest(output.lastTest, context)
3776
- : undefined,
3777
- state: __expectString(output.state),
3778
- } as any;
3779
- };
3780
-
3781
- const deserializeAws_restJson1LifeCycleLastCutover = (output: any, context: __SerdeContext): LifeCycleLastCutover => {
3782
- return {
3783
- finalized:
3784
- output.finalized !== undefined && output.finalized !== null
3785
- ? deserializeAws_restJson1LifeCycleLastCutoverFinalized(output.finalized, context)
3786
- : undefined,
3787
- initiated:
3788
- output.initiated !== undefined && output.initiated !== null
3789
- ? deserializeAws_restJson1LifeCycleLastCutoverInitiated(output.initiated, context)
3790
- : undefined,
3791
- reverted:
3792
- output.reverted !== undefined && output.reverted !== null
3793
- ? deserializeAws_restJson1LifeCycleLastCutoverReverted(output.reverted, context)
3794
- : undefined,
3795
- } as any;
3796
- };
3797
-
3798
- const deserializeAws_restJson1LifeCycleLastCutoverFinalized = (
3799
- output: any,
3800
- context: __SerdeContext
3801
- ): LifeCycleLastCutoverFinalized => {
3802
- return {
3803
- apiCallDateTime: __expectString(output.apiCallDateTime),
3804
- } as any;
3805
- };
3806
-
3807
- const deserializeAws_restJson1LifeCycleLastCutoverInitiated = (
3808
- output: any,
3809
- context: __SerdeContext
3810
- ): LifeCycleLastCutoverInitiated => {
3811
- return {
3812
- apiCallDateTime: __expectString(output.apiCallDateTime),
3813
- jobID: __expectString(output.jobID),
3814
- } as any;
3815
- };
3816
-
3817
- const deserializeAws_restJson1LifeCycleLastCutoverReverted = (
3818
- output: any,
3819
- context: __SerdeContext
3820
- ): LifeCycleLastCutoverReverted => {
3821
- return {
3822
- apiCallDateTime: __expectString(output.apiCallDateTime),
3823
- } as any;
3824
- };
3825
-
3826
- const deserializeAws_restJson1LifeCycleLastTest = (output: any, context: __SerdeContext): LifeCycleLastTest => {
3827
- return {
3828
- finalized:
3829
- output.finalized !== undefined && output.finalized !== null
3830
- ? deserializeAws_restJson1LifeCycleLastTestFinalized(output.finalized, context)
3831
- : undefined,
3832
- initiated:
3833
- output.initiated !== undefined && output.initiated !== null
3834
- ? deserializeAws_restJson1LifeCycleLastTestInitiated(output.initiated, context)
3835
- : undefined,
3836
- reverted:
3837
- output.reverted !== undefined && output.reverted !== null
3838
- ? deserializeAws_restJson1LifeCycleLastTestReverted(output.reverted, context)
3839
- : undefined,
3840
- } as any;
3841
- };
3842
-
3843
- const deserializeAws_restJson1LifeCycleLastTestFinalized = (
3844
- output: any,
3845
- context: __SerdeContext
3846
- ): LifeCycleLastTestFinalized => {
3847
- return {
3848
- apiCallDateTime: __expectString(output.apiCallDateTime),
3849
- } as any;
3850
- };
3851
-
3852
- const deserializeAws_restJson1LifeCycleLastTestInitiated = (
3853
- output: any,
3854
- context: __SerdeContext
3855
- ): LifeCycleLastTestInitiated => {
3856
- return {
3857
- apiCallDateTime: __expectString(output.apiCallDateTime),
3858
- jobID: __expectString(output.jobID),
3859
- } as any;
3860
- };
3861
-
3862
- const deserializeAws_restJson1LifeCycleLastTestReverted = (
3863
- output: any,
3864
- context: __SerdeContext
3865
- ): LifeCycleLastTestReverted => {
3866
- return {
3867
- apiCallDateTime: __expectString(output.apiCallDateTime),
3868
- } as any;
3869
- };
3870
-
3871
- const deserializeAws_restJson1NetworkInterface = (output: any, context: __SerdeContext): NetworkInterface => {
3872
- return {
3873
- ips:
3874
- output.ips !== undefined && output.ips !== null
3875
- ? deserializeAws_restJson1IPsList(output.ips, context)
3876
- : undefined,
3877
- isPrimary: __expectBoolean(output.isPrimary),
3878
- macAddress: __expectString(output.macAddress),
3879
- } as any;
3880
- };
3881
-
3882
- const deserializeAws_restJson1NetworkInterfaces = (output: any, context: __SerdeContext): NetworkInterface[] => {
3883
- return (output || [])
3884
- .filter((e: any) => e != null)
3885
- .map((entry: any) => {
3886
- if (entry === null) {
3887
- return null as any;
3888
- }
3889
- return deserializeAws_restJson1NetworkInterface(entry, context);
3890
- });
3891
- };
3892
-
3893
- const deserializeAws_restJson1OS = (output: any, context: __SerdeContext): OS => {
3894
- return {
3895
- fullString: __expectString(output.fullString),
3896
- } as any;
3897
- };
3898
-
3899
- const deserializeAws_restJson1ParticipatingServer = (output: any, context: __SerdeContext): ParticipatingServer => {
3900
- return {
3901
- launchStatus: __expectString(output.launchStatus),
3902
- sourceServerID: __expectString(output.sourceServerID),
3903
- } as any;
3904
- };
3905
-
3906
- const deserializeAws_restJson1ParticipatingServers = (output: any, context: __SerdeContext): ParticipatingServer[] => {
3907
- return (output || [])
3908
- .filter((e: any) => e != null)
3909
- .map((entry: any) => {
3910
- if (entry === null) {
3911
- return null as any;
3912
- }
3913
- return deserializeAws_restJson1ParticipatingServer(entry, context);
3914
- });
3915
- };
3916
-
3917
- const deserializeAws_restJson1ReplicationConfigurationReplicatedDisk = (
3918
- output: any,
3919
- context: __SerdeContext
3920
- ): ReplicationConfigurationReplicatedDisk => {
3921
- return {
3922
- deviceName: __expectString(output.deviceName),
3923
- iops: __expectLong(output.iops),
3924
- isBootDisk: __expectBoolean(output.isBootDisk),
3925
- stagingDiskType: __expectString(output.stagingDiskType),
3926
- } as any;
3927
- };
3928
-
3929
- const deserializeAws_restJson1ReplicationConfigurationReplicatedDisks = (
3930
- output: any,
3931
- context: __SerdeContext
3932
- ): ReplicationConfigurationReplicatedDisk[] => {
3933
- return (output || [])
3934
- .filter((e: any) => e != null)
3935
- .map((entry: any) => {
3936
- if (entry === null) {
3937
- return null as any;
3938
- }
3939
- return deserializeAws_restJson1ReplicationConfigurationReplicatedDisk(entry, context);
3940
- });
3941
- };
3942
-
3943
- const deserializeAws_restJson1ReplicationConfigurationTemplate = (
3944
- output: any,
3945
- context: __SerdeContext
3946
- ): ReplicationConfigurationTemplate => {
3947
- return {
3948
- arn: __expectString(output.arn),
3949
- associateDefaultSecurityGroup: __expectBoolean(output.associateDefaultSecurityGroup),
3950
- bandwidthThrottling: __expectLong(output.bandwidthThrottling),
3951
- createPublicIP: __expectBoolean(output.createPublicIP),
3952
- dataPlaneRouting: __expectString(output.dataPlaneRouting),
3953
- defaultLargeStagingDiskType: __expectString(output.defaultLargeStagingDiskType),
3954
- ebsEncryption: __expectString(output.ebsEncryption),
3955
- ebsEncryptionKeyArn: __expectString(output.ebsEncryptionKeyArn),
3956
- replicationConfigurationTemplateID: __expectString(output.replicationConfigurationTemplateID),
3957
- replicationServerInstanceType: __expectString(output.replicationServerInstanceType),
3958
- replicationServersSecurityGroupsIDs:
3959
- output.replicationServersSecurityGroupsIDs !== undefined && output.replicationServersSecurityGroupsIDs !== null
3960
- ? deserializeAws_restJson1ReplicationServersSecurityGroupsIDs(
3961
- output.replicationServersSecurityGroupsIDs,
3962
- context
3963
- )
3964
- : undefined,
3965
- stagingAreaSubnetId: __expectString(output.stagingAreaSubnetId),
3966
- stagingAreaTags:
3967
- output.stagingAreaTags !== undefined && output.stagingAreaTags !== null
3968
- ? deserializeAws_restJson1TagsMap(output.stagingAreaTags, context)
3969
- : undefined,
3970
- tags:
3971
- output.tags !== undefined && output.tags !== null
3972
- ? deserializeAws_restJson1TagsMap(output.tags, context)
3973
- : undefined,
3974
- useDedicatedReplicationServer: __expectBoolean(output.useDedicatedReplicationServer),
3975
- } as any;
3976
- };
3977
-
3978
- const deserializeAws_restJson1ReplicationConfigurationTemplates = (
3979
- output: any,
3980
- context: __SerdeContext
3981
- ): ReplicationConfigurationTemplate[] => {
3982
- return (output || [])
3983
- .filter((e: any) => e != null)
3984
- .map((entry: any) => {
3985
- if (entry === null) {
3986
- return null as any;
3987
- }
3988
- return deserializeAws_restJson1ReplicationConfigurationTemplate(entry, context);
3989
- });
3990
- };
3991
-
3992
- const deserializeAws_restJson1ReplicationServersSecurityGroupsIDs = (
3993
- output: any,
3994
- context: __SerdeContext
3995
- ): string[] => {
3996
- return (output || [])
3997
- .filter((e: any) => e != null)
3998
- .map((entry: any) => {
3999
- if (entry === null) {
4000
- return null as any;
4001
- }
4002
- return __expectString(entry) as any;
4003
- });
4004
- };
4005
-
4006
- const deserializeAws_restJson1SourceProperties = (output: any, context: __SerdeContext): SourceProperties => {
4007
- return {
4008
- cpus:
4009
- output.cpus !== undefined && output.cpus !== null
4010
- ? deserializeAws_restJson1Cpus(output.cpus, context)
4011
- : undefined,
4012
- disks:
4013
- output.disks !== undefined && output.disks !== null
4014
- ? deserializeAws_restJson1Disks(output.disks, context)
4015
- : undefined,
4016
- identificationHints:
4017
- output.identificationHints !== undefined && output.identificationHints !== null
4018
- ? deserializeAws_restJson1IdentificationHints(output.identificationHints, context)
4019
- : undefined,
4020
- lastUpdatedDateTime: __expectString(output.lastUpdatedDateTime),
4021
- networkInterfaces:
4022
- output.networkInterfaces !== undefined && output.networkInterfaces !== null
4023
- ? deserializeAws_restJson1NetworkInterfaces(output.networkInterfaces, context)
4024
- : undefined,
4025
- os: output.os !== undefined && output.os !== null ? deserializeAws_restJson1OS(output.os, context) : undefined,
4026
- ramBytes: __expectLong(output.ramBytes),
4027
- recommendedInstanceType: __expectString(output.recommendedInstanceType),
4028
- } as any;
4029
- };
4030
-
4031
- const deserializeAws_restJson1SourceServer = (output: any, context: __SerdeContext): SourceServer => {
4032
- return {
4033
- arn: __expectString(output.arn),
4034
- dataReplicationInfo:
4035
- output.dataReplicationInfo !== undefined && output.dataReplicationInfo !== null
4036
- ? deserializeAws_restJson1DataReplicationInfo(output.dataReplicationInfo, context)
4037
- : undefined,
4038
- isArchived: __expectBoolean(output.isArchived),
4039
- launchedInstance:
4040
- output.launchedInstance !== undefined && output.launchedInstance !== null
4041
- ? deserializeAws_restJson1LaunchedInstance(output.launchedInstance, context)
4042
- : undefined,
4043
- lifeCycle:
4044
- output.lifeCycle !== undefined && output.lifeCycle !== null
4045
- ? deserializeAws_restJson1LifeCycle(output.lifeCycle, context)
4046
- : undefined,
4047
- sourceProperties:
4048
- output.sourceProperties !== undefined && output.sourceProperties !== null
4049
- ? deserializeAws_restJson1SourceProperties(output.sourceProperties, context)
4050
- : undefined,
4051
- sourceServerID: __expectString(output.sourceServerID),
4052
- tags:
4053
- output.tags !== undefined && output.tags !== null
4054
- ? deserializeAws_restJson1TagsMap(output.tags, context)
4055
- : undefined,
4056
- } as any;
4057
- };
4058
-
4059
- const deserializeAws_restJson1SourceServersList = (output: any, context: __SerdeContext): SourceServer[] => {
4060
- return (output || [])
4061
- .filter((e: any) => e != null)
4062
- .map((entry: any) => {
4063
- if (entry === null) {
4064
- return null as any;
4065
- }
4066
- return deserializeAws_restJson1SourceServer(entry, context);
4067
- });
4068
- };
4069
-
4070
- const deserializeAws_restJson1TagsMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
4071
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
4072
- if (value === null) {
4073
- return acc;
4074
- }
4075
- return {
4076
- ...acc,
4077
- [key]: __expectString(value) as any,
4078
- };
4079
- }, {});
4080
- };
4081
-
4082
- const deserializeAws_restJson1ValidationExceptionField = (
4083
- output: any,
4084
- context: __SerdeContext
4085
- ): ValidationExceptionField => {
4086
- return {
4087
- message: __expectString(output.message),
4088
- name: __expectString(output.name),
4089
- } as any;
4090
- };
4091
-
4092
- const deserializeAws_restJson1ValidationExceptionFieldList = (
4093
- output: any,
4094
- context: __SerdeContext
4095
- ): ValidationExceptionField[] => {
4096
- return (output || [])
4097
- .filter((e: any) => e != null)
4098
- .map((entry: any) => {
4099
- if (entry === null) {
4100
- return null as any;
4101
- }
4102
- return deserializeAws_restJson1ValidationExceptionField(entry, context);
4103
- });
4104
- };
4105
-
4106
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
4107
- httpStatusCode: output.statusCode,
4108
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
4109
- extendedRequestId: output.headers["x-amz-id-2"],
4110
- cfId: output.headers["x-amz-cf-id"],
4111
- });
4112
-
4113
- // Collect low-level response body stream to Uint8Array.
4114
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
4115
- if (streamBody instanceof Uint8Array) {
4116
- return Promise.resolve(streamBody);
4117
- }
4118
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4119
- };
4120
-
4121
- // Encode Uint8Array data into string with utf-8.
4122
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
4123
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
4124
-
4125
- const isSerializableHeaderValue = (value: any): boolean =>
4126
- value !== undefined &&
4127
- value !== null &&
4128
- value !== "" &&
4129
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
4130
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
4131
-
4132
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
4133
- collectBodyString(streamBody, context).then((encoded) => {
4134
- if (encoded.length) {
4135
- return JSON.parse(encoded);
4136
- }
4137
- return {};
4138
- });
4139
-
4140
- /**
4141
- * Load an error code for the aws.rest-json-1.1 protocol.
4142
- */
4143
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
4144
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
4145
-
4146
- const sanitizeErrorCode = (rawValue: string): string => {
4147
- let cleanValue = rawValue;
4148
- if (cleanValue.indexOf(":") >= 0) {
4149
- cleanValue = cleanValue.split(":")[0];
4150
- }
4151
- if (cleanValue.indexOf("#") >= 0) {
4152
- cleanValue = cleanValue.split("#")[1];
4153
- }
4154
- return cleanValue;
4155
- };
4156
-
4157
- const headerKey = findKey(output.headers, "x-amzn-errortype");
4158
- if (headerKey !== undefined) {
4159
- return sanitizeErrorCode(output.headers[headerKey]);
4160
- }
4161
-
4162
- if (data.code !== undefined) {
4163
- return sanitizeErrorCode(data.code);
4164
- }
4165
-
4166
- if (data["__type"] !== undefined) {
4167
- return sanitizeErrorCode(data["__type"]);
4168
- }
4169
-
4170
- return "";
4171
- };