@aws-sdk/client-codeguruprofiler 3.34.0 → 3.37.0

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