@aws-sdk/client-qconnect 3.461.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 (283) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +545 -0
  3. package/dist-cjs/QConnect.js +93 -0
  4. package/dist-cjs/QConnectClient.js +43 -0
  5. package/dist-cjs/commands/CreateAssistantAssociationCommand.js +51 -0
  6. package/dist-cjs/commands/CreateAssistantCommand.js +51 -0
  7. package/dist-cjs/commands/CreateContentCommand.js +52 -0
  8. package/dist-cjs/commands/CreateKnowledgeBaseCommand.js +51 -0
  9. package/dist-cjs/commands/CreateQuickResponseCommand.js +52 -0
  10. package/dist-cjs/commands/CreateSessionCommand.js +51 -0
  11. package/dist-cjs/commands/DeleteAssistantAssociationCommand.js +51 -0
  12. package/dist-cjs/commands/DeleteAssistantCommand.js +51 -0
  13. package/dist-cjs/commands/DeleteContentCommand.js +51 -0
  14. package/dist-cjs/commands/DeleteImportJobCommand.js +51 -0
  15. package/dist-cjs/commands/DeleteKnowledgeBaseCommand.js +51 -0
  16. package/dist-cjs/commands/DeleteQuickResponseCommand.js +51 -0
  17. package/dist-cjs/commands/GetAssistantAssociationCommand.js +51 -0
  18. package/dist-cjs/commands/GetAssistantCommand.js +51 -0
  19. package/dist-cjs/commands/GetContentCommand.js +52 -0
  20. package/dist-cjs/commands/GetContentSummaryCommand.js +51 -0
  21. package/dist-cjs/commands/GetImportJobCommand.js +52 -0
  22. package/dist-cjs/commands/GetKnowledgeBaseCommand.js +51 -0
  23. package/dist-cjs/commands/GetQuickResponseCommand.js +52 -0
  24. package/dist-cjs/commands/GetRecommendationsCommand.js +52 -0
  25. package/dist-cjs/commands/GetSessionCommand.js +51 -0
  26. package/dist-cjs/commands/ListAssistantAssociationsCommand.js +51 -0
  27. package/dist-cjs/commands/ListAssistantsCommand.js +51 -0
  28. package/dist-cjs/commands/ListContentsCommand.js +51 -0
  29. package/dist-cjs/commands/ListImportJobsCommand.js +51 -0
  30. package/dist-cjs/commands/ListKnowledgeBasesCommand.js +51 -0
  31. package/dist-cjs/commands/ListQuickResponsesCommand.js +52 -0
  32. package/dist-cjs/commands/ListTagsForResourceCommand.js +51 -0
  33. package/dist-cjs/commands/NotifyRecommendationsReceivedCommand.js +51 -0
  34. package/dist-cjs/commands/QueryAssistantCommand.js +52 -0
  35. package/dist-cjs/commands/RemoveKnowledgeBaseTemplateUriCommand.js +51 -0
  36. package/dist-cjs/commands/SearchContentCommand.js +51 -0
  37. package/dist-cjs/commands/SearchQuickResponsesCommand.js +52 -0
  38. package/dist-cjs/commands/SearchSessionsCommand.js +51 -0
  39. package/dist-cjs/commands/StartContentUploadCommand.js +52 -0
  40. package/dist-cjs/commands/StartImportJobCommand.js +52 -0
  41. package/dist-cjs/commands/TagResourceCommand.js +51 -0
  42. package/dist-cjs/commands/UntagResourceCommand.js +51 -0
  43. package/dist-cjs/commands/UpdateContentCommand.js +52 -0
  44. package/dist-cjs/commands/UpdateKnowledgeBaseTemplateUriCommand.js +51 -0
  45. package/dist-cjs/commands/UpdateQuickResponseCommand.js +52 -0
  46. package/dist-cjs/commands/index.js +44 -0
  47. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  48. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  49. package/dist-cjs/endpoint/ruleset.js +7 -0
  50. package/dist-cjs/extensionConfiguration.js +2 -0
  51. package/dist-cjs/index.js +12 -0
  52. package/dist-cjs/models/QConnectServiceException.js +12 -0
  53. package/dist-cjs/models/index.js +4 -0
  54. package/dist-cjs/models/models_0.js +559 -0
  55. package/dist-cjs/pagination/Interfaces.js +2 -0
  56. package/dist-cjs/pagination/ListAssistantAssociationsPaginator.js +29 -0
  57. package/dist-cjs/pagination/ListAssistantsPaginator.js +29 -0
  58. package/dist-cjs/pagination/ListContentsPaginator.js +29 -0
  59. package/dist-cjs/pagination/ListImportJobsPaginator.js +29 -0
  60. package/dist-cjs/pagination/ListKnowledgeBasesPaginator.js +29 -0
  61. package/dist-cjs/pagination/ListQuickResponsesPaginator.js +29 -0
  62. package/dist-cjs/pagination/QueryAssistantPaginator.js +29 -0
  63. package/dist-cjs/pagination/SearchContentPaginator.js +29 -0
  64. package/dist-cjs/pagination/SearchQuickResponsesPaginator.js +29 -0
  65. package/dist-cjs/pagination/SearchSessionsPaginator.js +29 -0
  66. package/dist-cjs/pagination/index.js +14 -0
  67. package/dist-cjs/protocols/Aws_restJson1.js +2993 -0
  68. package/dist-cjs/runtimeConfig.browser.js +39 -0
  69. package/dist-cjs/runtimeConfig.js +50 -0
  70. package/dist-cjs/runtimeConfig.native.js +15 -0
  71. package/dist-cjs/runtimeConfig.shared.js +24 -0
  72. package/dist-cjs/runtimeExtensions.js +22 -0
  73. package/dist-es/QConnect.js +89 -0
  74. package/dist-es/QConnectClient.js +39 -0
  75. package/dist-es/commands/CreateAssistantAssociationCommand.js +47 -0
  76. package/dist-es/commands/CreateAssistantCommand.js +47 -0
  77. package/dist-es/commands/CreateContentCommand.js +48 -0
  78. package/dist-es/commands/CreateKnowledgeBaseCommand.js +47 -0
  79. package/dist-es/commands/CreateQuickResponseCommand.js +48 -0
  80. package/dist-es/commands/CreateSessionCommand.js +47 -0
  81. package/dist-es/commands/DeleteAssistantAssociationCommand.js +47 -0
  82. package/dist-es/commands/DeleteAssistantCommand.js +47 -0
  83. package/dist-es/commands/DeleteContentCommand.js +47 -0
  84. package/dist-es/commands/DeleteImportJobCommand.js +47 -0
  85. package/dist-es/commands/DeleteKnowledgeBaseCommand.js +47 -0
  86. package/dist-es/commands/DeleteQuickResponseCommand.js +47 -0
  87. package/dist-es/commands/GetAssistantAssociationCommand.js +47 -0
  88. package/dist-es/commands/GetAssistantCommand.js +47 -0
  89. package/dist-es/commands/GetContentCommand.js +48 -0
  90. package/dist-es/commands/GetContentSummaryCommand.js +47 -0
  91. package/dist-es/commands/GetImportJobCommand.js +48 -0
  92. package/dist-es/commands/GetKnowledgeBaseCommand.js +47 -0
  93. package/dist-es/commands/GetQuickResponseCommand.js +48 -0
  94. package/dist-es/commands/GetRecommendationsCommand.js +48 -0
  95. package/dist-es/commands/GetSessionCommand.js +47 -0
  96. package/dist-es/commands/ListAssistantAssociationsCommand.js +47 -0
  97. package/dist-es/commands/ListAssistantsCommand.js +47 -0
  98. package/dist-es/commands/ListContentsCommand.js +47 -0
  99. package/dist-es/commands/ListImportJobsCommand.js +47 -0
  100. package/dist-es/commands/ListKnowledgeBasesCommand.js +47 -0
  101. package/dist-es/commands/ListQuickResponsesCommand.js +48 -0
  102. package/dist-es/commands/ListTagsForResourceCommand.js +47 -0
  103. package/dist-es/commands/NotifyRecommendationsReceivedCommand.js +47 -0
  104. package/dist-es/commands/QueryAssistantCommand.js +48 -0
  105. package/dist-es/commands/RemoveKnowledgeBaseTemplateUriCommand.js +47 -0
  106. package/dist-es/commands/SearchContentCommand.js +47 -0
  107. package/dist-es/commands/SearchQuickResponsesCommand.js +48 -0
  108. package/dist-es/commands/SearchSessionsCommand.js +47 -0
  109. package/dist-es/commands/StartContentUploadCommand.js +48 -0
  110. package/dist-es/commands/StartImportJobCommand.js +48 -0
  111. package/dist-es/commands/TagResourceCommand.js +47 -0
  112. package/dist-es/commands/UntagResourceCommand.js +47 -0
  113. package/dist-es/commands/UpdateContentCommand.js +48 -0
  114. package/dist-es/commands/UpdateKnowledgeBaseTemplateUriCommand.js +47 -0
  115. package/dist-es/commands/UpdateQuickResponseCommand.js +48 -0
  116. package/dist-es/commands/index.js +41 -0
  117. package/dist-es/endpoint/EndpointParameters.js +8 -0
  118. package/dist-es/endpoint/endpointResolver.js +8 -0
  119. package/dist-es/endpoint/ruleset.js +4 -0
  120. package/dist-es/extensionConfiguration.js +1 -0
  121. package/dist-es/index.js +7 -0
  122. package/dist-es/models/QConnectServiceException.js +8 -0
  123. package/dist-es/models/index.js +1 -0
  124. package/dist-es/models/models_0.js +508 -0
  125. package/dist-es/pagination/Interfaces.js +1 -0
  126. package/dist-es/pagination/ListAssistantAssociationsPaginator.js +25 -0
  127. package/dist-es/pagination/ListAssistantsPaginator.js +25 -0
  128. package/dist-es/pagination/ListContentsPaginator.js +25 -0
  129. package/dist-es/pagination/ListImportJobsPaginator.js +25 -0
  130. package/dist-es/pagination/ListKnowledgeBasesPaginator.js +25 -0
  131. package/dist-es/pagination/ListQuickResponsesPaginator.js +25 -0
  132. package/dist-es/pagination/QueryAssistantPaginator.js +25 -0
  133. package/dist-es/pagination/SearchContentPaginator.js +25 -0
  134. package/dist-es/pagination/SearchQuickResponsesPaginator.js +25 -0
  135. package/dist-es/pagination/SearchSessionsPaginator.js +25 -0
  136. package/dist-es/pagination/index.js +11 -0
  137. package/dist-es/protocols/Aws_restJson1.js +2907 -0
  138. package/dist-es/runtimeConfig.browser.js +34 -0
  139. package/dist-es/runtimeConfig.js +45 -0
  140. package/dist-es/runtimeConfig.native.js +11 -0
  141. package/dist-es/runtimeConfig.shared.js +20 -0
  142. package/dist-es/runtimeExtensions.js +18 -0
  143. package/dist-types/QConnect.d.ts +309 -0
  144. package/dist-types/QConnectClient.d.ts +222 -0
  145. package/dist-types/commands/CreateAssistantAssociationCommand.d.ts +117 -0
  146. package/dist-types/commands/CreateAssistantCommand.d.ts +117 -0
  147. package/dist-types/commands/CreateContentCommand.d.ts +123 -0
  148. package/dist-types/commands/CreateKnowledgeBaseCommand.d.ts +157 -0
  149. package/dist-types/commands/CreateQuickResponseCommand.d.ts +149 -0
  150. package/dist-types/commands/CreateSessionCommand.d.ts +104 -0
  151. package/dist-types/commands/DeleteAssistantAssociationCommand.d.ts +81 -0
  152. package/dist-types/commands/DeleteAssistantCommand.d.ts +80 -0
  153. package/dist-types/commands/DeleteContentCommand.d.ts +81 -0
  154. package/dist-types/commands/DeleteImportJobCommand.d.ts +87 -0
  155. package/dist-types/commands/DeleteKnowledgeBaseCommand.d.ts +94 -0
  156. package/dist-types/commands/DeleteQuickResponseCommand.d.ts +81 -0
  157. package/dist-types/commands/GetAssistantAssociationCommand.d.ts +98 -0
  158. package/dist-types/commands/GetAssistantCommand.d.ts +101 -0
  159. package/dist-types/commands/GetContentCommand.d.ts +102 -0
  160. package/dist-types/commands/GetContentSummaryCommand.d.ts +99 -0
  161. package/dist-types/commands/GetImportJobCommand.d.ts +106 -0
  162. package/dist-types/commands/GetKnowledgeBaseCommand.d.ts +107 -0
  163. package/dist-types/commands/GetQuickResponseCommand.d.ts +118 -0
  164. package/dist-types/commands/GetRecommendationsCommand.d.ts +239 -0
  165. package/dist-types/commands/GetSessionCommand.d.ts +94 -0
  166. package/dist-types/commands/ListAssistantAssociationsCommand.d.ts +102 -0
  167. package/dist-types/commands/ListAssistantsCommand.d.ts +102 -0
  168. package/dist-types/commands/ListContentsCommand.d.ts +103 -0
  169. package/dist-types/commands/ListImportJobsCommand.d.ts +104 -0
  170. package/dist-types/commands/ListKnowledgeBasesCommand.d.ts +107 -0
  171. package/dist-types/commands/ListQuickResponsesCommand.d.ts +106 -0
  172. package/dist-types/commands/ListTagsForResourceCommand.d.ts +78 -0
  173. package/dist-types/commands/NotifyRecommendationsReceivedCommand.d.ts +96 -0
  174. package/dist-types/commands/QueryAssistantCommand.d.ts +238 -0
  175. package/dist-types/commands/RemoveKnowledgeBaseTemplateUriCommand.d.ts +80 -0
  176. package/dist-types/commands/SearchContentCommand.d.ts +113 -0
  177. package/dist-types/commands/SearchQuickResponsesCommand.d.ts +163 -0
  178. package/dist-types/commands/SearchSessionsCommand.d.ts +101 -0
  179. package/dist-types/commands/StartContentUploadCommand.d.ts +92 -0
  180. package/dist-types/commands/StartImportJobCommand.d.ts +135 -0
  181. package/dist-types/commands/TagResourceCommand.d.ts +80 -0
  182. package/dist-types/commands/UntagResourceCommand.d.ts +77 -0
  183. package/dist-types/commands/UpdateContentCommand.d.ts +114 -0
  184. package/dist-types/commands/UpdateKnowledgeBaseTemplateUriCommand.d.ts +113 -0
  185. package/dist-types/commands/UpdateQuickResponseCommand.d.ts +149 -0
  186. package/dist-types/commands/index.d.ts +41 -0
  187. package/dist-types/endpoint/EndpointParameters.d.ts +22 -0
  188. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  189. package/dist-types/endpoint/ruleset.d.ts +2 -0
  190. package/dist-types/extensionConfiguration.d.ts +8 -0
  191. package/dist-types/index.d.ts +27 -0
  192. package/dist-types/models/QConnectServiceException.d.ts +13 -0
  193. package/dist-types/models/index.d.ts +1 -0
  194. package/dist-types/models/models_0.d.ts +4249 -0
  195. package/dist-types/pagination/Interfaces.d.ts +8 -0
  196. package/dist-types/pagination/ListAssistantAssociationsPaginator.d.ts +7 -0
  197. package/dist-types/pagination/ListAssistantsPaginator.d.ts +7 -0
  198. package/dist-types/pagination/ListContentsPaginator.d.ts +7 -0
  199. package/dist-types/pagination/ListImportJobsPaginator.d.ts +7 -0
  200. package/dist-types/pagination/ListKnowledgeBasesPaginator.d.ts +7 -0
  201. package/dist-types/pagination/ListQuickResponsesPaginator.d.ts +7 -0
  202. package/dist-types/pagination/QueryAssistantPaginator.d.ts +7 -0
  203. package/dist-types/pagination/SearchContentPaginator.d.ts +7 -0
  204. package/dist-types/pagination/SearchQuickResponsesPaginator.d.ts +7 -0
  205. package/dist-types/pagination/SearchSessionsPaginator.d.ts +7 -0
  206. package/dist-types/pagination/index.d.ts +11 -0
  207. package/dist-types/protocols/Aws_restJson1.d.ts +371 -0
  208. package/dist-types/runtimeConfig.browser.d.ts +46 -0
  209. package/dist-types/runtimeConfig.d.ts +46 -0
  210. package/dist-types/runtimeConfig.native.d.ts +45 -0
  211. package/dist-types/runtimeConfig.shared.d.ts +19 -0
  212. package/dist-types/runtimeExtensions.d.ts +17 -0
  213. package/dist-types/ts3.4/QConnect.d.ts +702 -0
  214. package/dist-types/ts3.4/QConnectClient.d.ts +364 -0
  215. package/dist-types/ts3.4/commands/CreateAssistantAssociationCommand.d.ts +42 -0
  216. package/dist-types/ts3.4/commands/CreateAssistantCommand.d.ts +38 -0
  217. package/dist-types/ts3.4/commands/CreateContentCommand.d.ts +38 -0
  218. package/dist-types/ts3.4/commands/CreateKnowledgeBaseCommand.d.ts +39 -0
  219. package/dist-types/ts3.4/commands/CreateQuickResponseCommand.d.ts +39 -0
  220. package/dist-types/ts3.4/commands/CreateSessionCommand.d.ts +38 -0
  221. package/dist-types/ts3.4/commands/DeleteAssistantAssociationCommand.d.ts +42 -0
  222. package/dist-types/ts3.4/commands/DeleteAssistantCommand.d.ts +38 -0
  223. package/dist-types/ts3.4/commands/DeleteContentCommand.d.ts +38 -0
  224. package/dist-types/ts3.4/commands/DeleteImportJobCommand.d.ts +38 -0
  225. package/dist-types/ts3.4/commands/DeleteKnowledgeBaseCommand.d.ts +39 -0
  226. package/dist-types/ts3.4/commands/DeleteQuickResponseCommand.d.ts +39 -0
  227. package/dist-types/ts3.4/commands/GetAssistantAssociationCommand.d.ts +42 -0
  228. package/dist-types/ts3.4/commands/GetAssistantCommand.d.ts +35 -0
  229. package/dist-types/ts3.4/commands/GetContentCommand.d.ts +35 -0
  230. package/dist-types/ts3.4/commands/GetContentSummaryCommand.d.ts +39 -0
  231. package/dist-types/ts3.4/commands/GetImportJobCommand.d.ts +35 -0
  232. package/dist-types/ts3.4/commands/GetKnowledgeBaseCommand.d.ts +38 -0
  233. package/dist-types/ts3.4/commands/GetQuickResponseCommand.d.ts +38 -0
  234. package/dist-types/ts3.4/commands/GetRecommendationsCommand.d.ts +39 -0
  235. package/dist-types/ts3.4/commands/GetSessionCommand.d.ts +35 -0
  236. package/dist-types/ts3.4/commands/ListAssistantAssociationsCommand.d.ts +42 -0
  237. package/dist-types/ts3.4/commands/ListAssistantsCommand.d.ts +38 -0
  238. package/dist-types/ts3.4/commands/ListContentsCommand.d.ts +35 -0
  239. package/dist-types/ts3.4/commands/ListImportJobsCommand.d.ts +38 -0
  240. package/dist-types/ts3.4/commands/ListKnowledgeBasesCommand.d.ts +39 -0
  241. package/dist-types/ts3.4/commands/ListQuickResponsesCommand.d.ts +39 -0
  242. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
  243. package/dist-types/ts3.4/commands/NotifyRecommendationsReceivedCommand.d.ts +42 -0
  244. package/dist-types/ts3.4/commands/QueryAssistantCommand.d.ts +38 -0
  245. package/dist-types/ts3.4/commands/RemoveKnowledgeBaseTemplateUriCommand.d.ts +42 -0
  246. package/dist-types/ts3.4/commands/SearchContentCommand.d.ts +38 -0
  247. package/dist-types/ts3.4/commands/SearchQuickResponsesCommand.d.ts +42 -0
  248. package/dist-types/ts3.4/commands/SearchSessionsCommand.d.ts +38 -0
  249. package/dist-types/ts3.4/commands/StartContentUploadCommand.d.ts +39 -0
  250. package/dist-types/ts3.4/commands/StartImportJobCommand.d.ts +38 -0
  251. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
  252. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +38 -0
  253. package/dist-types/ts3.4/commands/UpdateContentCommand.d.ts +38 -0
  254. package/dist-types/ts3.4/commands/UpdateKnowledgeBaseTemplateUriCommand.d.ts +42 -0
  255. package/dist-types/ts3.4/commands/UpdateQuickResponseCommand.d.ts +39 -0
  256. package/dist-types/ts3.4/commands/index.d.ts +41 -0
  257. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
  258. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  259. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  260. package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
  261. package/dist-types/ts3.4/index.d.ts +10 -0
  262. package/dist-types/ts3.4/models/QConnectServiceException.d.ts +8 -0
  263. package/dist-types/ts3.4/models/index.d.ts +1 -0
  264. package/dist-types/ts3.4/models/models_0.d.ts +1241 -0
  265. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  266. package/dist-types/ts3.4/pagination/ListAssistantAssociationsPaginator.d.ts +11 -0
  267. package/dist-types/ts3.4/pagination/ListAssistantsPaginator.d.ts +11 -0
  268. package/dist-types/ts3.4/pagination/ListContentsPaginator.d.ts +11 -0
  269. package/dist-types/ts3.4/pagination/ListImportJobsPaginator.d.ts +11 -0
  270. package/dist-types/ts3.4/pagination/ListKnowledgeBasesPaginator.d.ts +11 -0
  271. package/dist-types/ts3.4/pagination/ListQuickResponsesPaginator.d.ts +11 -0
  272. package/dist-types/ts3.4/pagination/QueryAssistantPaginator.d.ts +11 -0
  273. package/dist-types/ts3.4/pagination/SearchContentPaginator.d.ts +11 -0
  274. package/dist-types/ts3.4/pagination/SearchQuickResponsesPaginator.d.ts +11 -0
  275. package/dist-types/ts3.4/pagination/SearchSessionsPaginator.d.ts +11 -0
  276. package/dist-types/ts3.4/pagination/index.d.ts +11 -0
  277. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +497 -0
  278. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
  279. package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
  280. package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
  281. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
  282. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  283. package/package.json +104 -0
@@ -0,0 +1,2993 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.de_DeleteContentCommand = exports.de_DeleteAssistantAssociationCommand = exports.de_DeleteAssistantCommand = exports.de_CreateSessionCommand = exports.de_CreateQuickResponseCommand = exports.de_CreateKnowledgeBaseCommand = exports.de_CreateContentCommand = exports.de_CreateAssistantAssociationCommand = exports.de_CreateAssistantCommand = exports.se_UpdateQuickResponseCommand = exports.se_UpdateKnowledgeBaseTemplateUriCommand = exports.se_UpdateContentCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StartImportJobCommand = exports.se_StartContentUploadCommand = exports.se_SearchSessionsCommand = exports.se_SearchQuickResponsesCommand = exports.se_SearchContentCommand = exports.se_RemoveKnowledgeBaseTemplateUriCommand = exports.se_QueryAssistantCommand = exports.se_NotifyRecommendationsReceivedCommand = exports.se_ListTagsForResourceCommand = exports.se_ListQuickResponsesCommand = exports.se_ListKnowledgeBasesCommand = exports.se_ListImportJobsCommand = exports.se_ListContentsCommand = exports.se_ListAssistantsCommand = exports.se_ListAssistantAssociationsCommand = exports.se_GetSessionCommand = exports.se_GetRecommendationsCommand = exports.se_GetQuickResponseCommand = exports.se_GetKnowledgeBaseCommand = exports.se_GetImportJobCommand = exports.se_GetContentSummaryCommand = exports.se_GetContentCommand = exports.se_GetAssistantAssociationCommand = exports.se_GetAssistantCommand = exports.se_DeleteQuickResponseCommand = exports.se_DeleteKnowledgeBaseCommand = exports.se_DeleteImportJobCommand = exports.se_DeleteContentCommand = exports.se_DeleteAssistantAssociationCommand = exports.se_DeleteAssistantCommand = exports.se_CreateSessionCommand = exports.se_CreateQuickResponseCommand = exports.se_CreateKnowledgeBaseCommand = exports.se_CreateContentCommand = exports.se_CreateAssistantAssociationCommand = exports.se_CreateAssistantCommand = void 0;
4
+ exports.de_UpdateQuickResponseCommand = exports.de_UpdateKnowledgeBaseTemplateUriCommand = exports.de_UpdateContentCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StartImportJobCommand = exports.de_StartContentUploadCommand = exports.de_SearchSessionsCommand = exports.de_SearchQuickResponsesCommand = exports.de_SearchContentCommand = exports.de_RemoveKnowledgeBaseTemplateUriCommand = exports.de_QueryAssistantCommand = exports.de_NotifyRecommendationsReceivedCommand = exports.de_ListTagsForResourceCommand = exports.de_ListQuickResponsesCommand = exports.de_ListKnowledgeBasesCommand = exports.de_ListImportJobsCommand = exports.de_ListContentsCommand = exports.de_ListAssistantsCommand = exports.de_ListAssistantAssociationsCommand = exports.de_GetSessionCommand = exports.de_GetRecommendationsCommand = exports.de_GetQuickResponseCommand = exports.de_GetKnowledgeBaseCommand = exports.de_GetImportJobCommand = exports.de_GetContentSummaryCommand = exports.de_GetContentCommand = exports.de_GetAssistantAssociationCommand = exports.de_GetAssistantCommand = exports.de_DeleteQuickResponseCommand = exports.de_DeleteKnowledgeBaseCommand = exports.de_DeleteImportJobCommand = void 0;
5
+ const core_1 = require("@aws-sdk/core");
6
+ const protocol_http_1 = require("@smithy/protocol-http");
7
+ const smithy_client_1 = require("@smithy/smithy-client");
8
+ const uuid_1 = require("uuid");
9
+ const models_0_1 = require("../models/models_0");
10
+ const QConnectServiceException_1 = require("../models/QConnectServiceException");
11
+ const se_CreateAssistantCommand = async (input, context) => {
12
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
13
+ const headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants";
17
+ let body;
18
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
19
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
20
+ description: [],
21
+ name: [],
22
+ serverSideEncryptionConfiguration: (_) => (0, smithy_client_1._json)(_),
23
+ tags: (_) => (0, smithy_client_1._json)(_),
24
+ type: [],
25
+ }));
26
+ return new protocol_http_1.HttpRequest({
27
+ protocol,
28
+ hostname,
29
+ port,
30
+ method: "POST",
31
+ headers,
32
+ path: resolvedPath,
33
+ body,
34
+ });
35
+ };
36
+ exports.se_CreateAssistantCommand = se_CreateAssistantCommand;
37
+ const se_CreateAssistantAssociationCommand = async (input, context) => {
38
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
39
+ const headers = {
40
+ "content-type": "application/json",
41
+ };
42
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/associations";
43
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
44
+ let body;
45
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
46
+ association: (_) => (0, smithy_client_1._json)(_),
47
+ associationType: [],
48
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
49
+ tags: (_) => (0, smithy_client_1._json)(_),
50
+ }));
51
+ return new protocol_http_1.HttpRequest({
52
+ protocol,
53
+ hostname,
54
+ port,
55
+ method: "POST",
56
+ headers,
57
+ path: resolvedPath,
58
+ body,
59
+ });
60
+ };
61
+ exports.se_CreateAssistantAssociationCommand = se_CreateAssistantAssociationCommand;
62
+ const se_CreateContentCommand = async (input, context) => {
63
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
64
+ const headers = {
65
+ "content-type": "application/json",
66
+ };
67
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
68
+ "/knowledgeBases/{knowledgeBaseId}/contents";
69
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
70
+ let body;
71
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
72
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
73
+ metadata: (_) => (0, smithy_client_1._json)(_),
74
+ name: [],
75
+ overrideLinkOutUri: [],
76
+ tags: (_) => (0, smithy_client_1._json)(_),
77
+ title: [],
78
+ uploadId: [],
79
+ }));
80
+ return new protocol_http_1.HttpRequest({
81
+ protocol,
82
+ hostname,
83
+ port,
84
+ method: "POST",
85
+ headers,
86
+ path: resolvedPath,
87
+ body,
88
+ });
89
+ };
90
+ exports.se_CreateContentCommand = se_CreateContentCommand;
91
+ const se_CreateKnowledgeBaseCommand = async (input, context) => {
92
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
93
+ const headers = {
94
+ "content-type": "application/json",
95
+ };
96
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases";
97
+ let body;
98
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
99
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
100
+ description: [],
101
+ knowledgeBaseType: [],
102
+ name: [],
103
+ renderingConfiguration: (_) => (0, smithy_client_1._json)(_),
104
+ serverSideEncryptionConfiguration: (_) => (0, smithy_client_1._json)(_),
105
+ sourceConfiguration: (_) => (0, smithy_client_1._json)(_),
106
+ tags: (_) => (0, smithy_client_1._json)(_),
107
+ }));
108
+ return new protocol_http_1.HttpRequest({
109
+ protocol,
110
+ hostname,
111
+ port,
112
+ method: "POST",
113
+ headers,
114
+ path: resolvedPath,
115
+ body,
116
+ });
117
+ };
118
+ exports.se_CreateKnowledgeBaseCommand = se_CreateKnowledgeBaseCommand;
119
+ const se_CreateQuickResponseCommand = async (input, context) => {
120
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
121
+ const headers = {
122
+ "content-type": "application/json",
123
+ };
124
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
125
+ "/knowledgeBases/{knowledgeBaseId}/quickResponses";
126
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
127
+ let body;
128
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
129
+ channels: (_) => (0, smithy_client_1._json)(_),
130
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
131
+ content: (_) => (0, smithy_client_1._json)(_),
132
+ contentType: [],
133
+ description: [],
134
+ groupingConfiguration: (_) => (0, smithy_client_1._json)(_),
135
+ isActive: [],
136
+ language: [],
137
+ name: [],
138
+ shortcutKey: [],
139
+ tags: (_) => (0, smithy_client_1._json)(_),
140
+ }));
141
+ return new protocol_http_1.HttpRequest({
142
+ protocol,
143
+ hostname,
144
+ port,
145
+ method: "POST",
146
+ headers,
147
+ path: resolvedPath,
148
+ body,
149
+ });
150
+ };
151
+ exports.se_CreateQuickResponseCommand = se_CreateQuickResponseCommand;
152
+ const se_CreateSessionCommand = async (input, context) => {
153
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
154
+ const headers = {
155
+ "content-type": "application/json",
156
+ };
157
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/sessions";
158
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
159
+ let body;
160
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
161
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
162
+ description: [],
163
+ name: [],
164
+ tags: (_) => (0, smithy_client_1._json)(_),
165
+ }));
166
+ return new protocol_http_1.HttpRequest({
167
+ protocol,
168
+ hostname,
169
+ port,
170
+ method: "POST",
171
+ headers,
172
+ path: resolvedPath,
173
+ body,
174
+ });
175
+ };
176
+ exports.se_CreateSessionCommand = se_CreateSessionCommand;
177
+ const se_DeleteAssistantCommand = async (input, context) => {
178
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
179
+ const headers = {};
180
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}";
181
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
182
+ let body;
183
+ return new protocol_http_1.HttpRequest({
184
+ protocol,
185
+ hostname,
186
+ port,
187
+ method: "DELETE",
188
+ headers,
189
+ path: resolvedPath,
190
+ body,
191
+ });
192
+ };
193
+ exports.se_DeleteAssistantCommand = se_DeleteAssistantCommand;
194
+ const se_DeleteAssistantAssociationCommand = async (input, context) => {
195
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
196
+ const headers = {};
197
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
198
+ "/assistants/{assistantId}/associations/{assistantAssociationId}";
199
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantAssociationId", () => input.assistantAssociationId, "{assistantAssociationId}", false);
200
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
201
+ let body;
202
+ return new protocol_http_1.HttpRequest({
203
+ protocol,
204
+ hostname,
205
+ port,
206
+ method: "DELETE",
207
+ headers,
208
+ path: resolvedPath,
209
+ body,
210
+ });
211
+ };
212
+ exports.se_DeleteAssistantAssociationCommand = se_DeleteAssistantAssociationCommand;
213
+ const se_DeleteContentCommand = async (input, context) => {
214
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
215
+ const headers = {};
216
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
217
+ "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
218
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
219
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
220
+ let body;
221
+ return new protocol_http_1.HttpRequest({
222
+ protocol,
223
+ hostname,
224
+ port,
225
+ method: "DELETE",
226
+ headers,
227
+ path: resolvedPath,
228
+ body,
229
+ });
230
+ };
231
+ exports.se_DeleteContentCommand = se_DeleteContentCommand;
232
+ const se_DeleteImportJobCommand = async (input, context) => {
233
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
234
+ const headers = {};
235
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
236
+ "/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}";
237
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
238
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "importJobId", () => input.importJobId, "{importJobId}", false);
239
+ let body;
240
+ return new protocol_http_1.HttpRequest({
241
+ protocol,
242
+ hostname,
243
+ port,
244
+ method: "DELETE",
245
+ headers,
246
+ path: resolvedPath,
247
+ body,
248
+ });
249
+ };
250
+ exports.se_DeleteImportJobCommand = se_DeleteImportJobCommand;
251
+ const se_DeleteKnowledgeBaseCommand = async (input, context) => {
252
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
253
+ const headers = {};
254
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}";
255
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
256
+ let body;
257
+ return new protocol_http_1.HttpRequest({
258
+ protocol,
259
+ hostname,
260
+ port,
261
+ method: "DELETE",
262
+ headers,
263
+ path: resolvedPath,
264
+ body,
265
+ });
266
+ };
267
+ exports.se_DeleteKnowledgeBaseCommand = se_DeleteKnowledgeBaseCommand;
268
+ const se_DeleteQuickResponseCommand = async (input, context) => {
269
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
270
+ const headers = {};
271
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
272
+ "/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}";
273
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
274
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "quickResponseId", () => input.quickResponseId, "{quickResponseId}", false);
275
+ let body;
276
+ return new protocol_http_1.HttpRequest({
277
+ protocol,
278
+ hostname,
279
+ port,
280
+ method: "DELETE",
281
+ headers,
282
+ path: resolvedPath,
283
+ body,
284
+ });
285
+ };
286
+ exports.se_DeleteQuickResponseCommand = se_DeleteQuickResponseCommand;
287
+ const se_GetAssistantCommand = async (input, context) => {
288
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
289
+ const headers = {};
290
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}";
291
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
292
+ let body;
293
+ return new protocol_http_1.HttpRequest({
294
+ protocol,
295
+ hostname,
296
+ port,
297
+ method: "GET",
298
+ headers,
299
+ path: resolvedPath,
300
+ body,
301
+ });
302
+ };
303
+ exports.se_GetAssistantCommand = se_GetAssistantCommand;
304
+ const se_GetAssistantAssociationCommand = async (input, context) => {
305
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
306
+ const headers = {};
307
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
308
+ "/assistants/{assistantId}/associations/{assistantAssociationId}";
309
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantAssociationId", () => input.assistantAssociationId, "{assistantAssociationId}", false);
310
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
311
+ let body;
312
+ return new protocol_http_1.HttpRequest({
313
+ protocol,
314
+ hostname,
315
+ port,
316
+ method: "GET",
317
+ headers,
318
+ path: resolvedPath,
319
+ body,
320
+ });
321
+ };
322
+ exports.se_GetAssistantAssociationCommand = se_GetAssistantAssociationCommand;
323
+ const se_GetContentCommand = async (input, context) => {
324
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
325
+ const headers = {};
326
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
327
+ "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
328
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
329
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
330
+ let body;
331
+ return new protocol_http_1.HttpRequest({
332
+ protocol,
333
+ hostname,
334
+ port,
335
+ method: "GET",
336
+ headers,
337
+ path: resolvedPath,
338
+ body,
339
+ });
340
+ };
341
+ exports.se_GetContentCommand = se_GetContentCommand;
342
+ const se_GetContentSummaryCommand = async (input, context) => {
343
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
344
+ const headers = {};
345
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
346
+ "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary";
347
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
348
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
349
+ let body;
350
+ return new protocol_http_1.HttpRequest({
351
+ protocol,
352
+ hostname,
353
+ port,
354
+ method: "GET",
355
+ headers,
356
+ path: resolvedPath,
357
+ body,
358
+ });
359
+ };
360
+ exports.se_GetContentSummaryCommand = se_GetContentSummaryCommand;
361
+ const se_GetImportJobCommand = async (input, context) => {
362
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
363
+ const headers = {};
364
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
365
+ "/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}";
366
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "importJobId", () => input.importJobId, "{importJobId}", false);
367
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
368
+ let body;
369
+ return new protocol_http_1.HttpRequest({
370
+ protocol,
371
+ hostname,
372
+ port,
373
+ method: "GET",
374
+ headers,
375
+ path: resolvedPath,
376
+ body,
377
+ });
378
+ };
379
+ exports.se_GetImportJobCommand = se_GetImportJobCommand;
380
+ const se_GetKnowledgeBaseCommand = async (input, context) => {
381
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
382
+ const headers = {};
383
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}";
384
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
385
+ let body;
386
+ return new protocol_http_1.HttpRequest({
387
+ protocol,
388
+ hostname,
389
+ port,
390
+ method: "GET",
391
+ headers,
392
+ path: resolvedPath,
393
+ body,
394
+ });
395
+ };
396
+ exports.se_GetKnowledgeBaseCommand = se_GetKnowledgeBaseCommand;
397
+ const se_GetQuickResponseCommand = async (input, context) => {
398
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
399
+ const headers = {};
400
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
401
+ "/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}";
402
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "quickResponseId", () => input.quickResponseId, "{quickResponseId}", false);
403
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
404
+ let body;
405
+ return new protocol_http_1.HttpRequest({
406
+ protocol,
407
+ hostname,
408
+ port,
409
+ method: "GET",
410
+ headers,
411
+ path: resolvedPath,
412
+ body,
413
+ });
414
+ };
415
+ exports.se_GetQuickResponseCommand = se_GetQuickResponseCommand;
416
+ const se_GetRecommendationsCommand = async (input, context) => {
417
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
418
+ const headers = {};
419
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
420
+ "/assistants/{assistantId}/sessions/{sessionId}/recommendations";
421
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
422
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
423
+ const query = (0, smithy_client_1.map)({
424
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
425
+ waitTimeSeconds: [() => input.waitTimeSeconds !== void 0, () => input.waitTimeSeconds.toString()],
426
+ });
427
+ let body;
428
+ return new protocol_http_1.HttpRequest({
429
+ protocol,
430
+ hostname,
431
+ port,
432
+ method: "GET",
433
+ headers,
434
+ path: resolvedPath,
435
+ query,
436
+ body,
437
+ });
438
+ };
439
+ exports.se_GetRecommendationsCommand = se_GetRecommendationsCommand;
440
+ const se_GetSessionCommand = async (input, context) => {
441
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
442
+ const headers = {};
443
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
444
+ "/assistants/{assistantId}/sessions/{sessionId}";
445
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
446
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
447
+ let body;
448
+ return new protocol_http_1.HttpRequest({
449
+ protocol,
450
+ hostname,
451
+ port,
452
+ method: "GET",
453
+ headers,
454
+ path: resolvedPath,
455
+ body,
456
+ });
457
+ };
458
+ exports.se_GetSessionCommand = se_GetSessionCommand;
459
+ const se_ListAssistantAssociationsCommand = async (input, context) => {
460
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
461
+ const headers = {};
462
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/associations";
463
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
464
+ const query = (0, smithy_client_1.map)({
465
+ nextToken: [, input.nextToken],
466
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
467
+ });
468
+ let body;
469
+ return new protocol_http_1.HttpRequest({
470
+ protocol,
471
+ hostname,
472
+ port,
473
+ method: "GET",
474
+ headers,
475
+ path: resolvedPath,
476
+ query,
477
+ body,
478
+ });
479
+ };
480
+ exports.se_ListAssistantAssociationsCommand = se_ListAssistantAssociationsCommand;
481
+ const se_ListAssistantsCommand = async (input, context) => {
482
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
483
+ const headers = {};
484
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants";
485
+ const query = (0, smithy_client_1.map)({
486
+ nextToken: [, input.nextToken],
487
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
488
+ });
489
+ let body;
490
+ return new protocol_http_1.HttpRequest({
491
+ protocol,
492
+ hostname,
493
+ port,
494
+ method: "GET",
495
+ headers,
496
+ path: resolvedPath,
497
+ query,
498
+ body,
499
+ });
500
+ };
501
+ exports.se_ListAssistantsCommand = se_ListAssistantsCommand;
502
+ const se_ListContentsCommand = async (input, context) => {
503
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
504
+ const headers = {};
505
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
506
+ "/knowledgeBases/{knowledgeBaseId}/contents";
507
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
508
+ const query = (0, smithy_client_1.map)({
509
+ nextToken: [, input.nextToken],
510
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
511
+ });
512
+ let body;
513
+ return new protocol_http_1.HttpRequest({
514
+ protocol,
515
+ hostname,
516
+ port,
517
+ method: "GET",
518
+ headers,
519
+ path: resolvedPath,
520
+ query,
521
+ body,
522
+ });
523
+ };
524
+ exports.se_ListContentsCommand = se_ListContentsCommand;
525
+ const se_ListImportJobsCommand = async (input, context) => {
526
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
527
+ const headers = {};
528
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
529
+ "/knowledgeBases/{knowledgeBaseId}/importJobs";
530
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
531
+ const query = (0, smithy_client_1.map)({
532
+ nextToken: [, input.nextToken],
533
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
534
+ });
535
+ let body;
536
+ return new protocol_http_1.HttpRequest({
537
+ protocol,
538
+ hostname,
539
+ port,
540
+ method: "GET",
541
+ headers,
542
+ path: resolvedPath,
543
+ query,
544
+ body,
545
+ });
546
+ };
547
+ exports.se_ListImportJobsCommand = se_ListImportJobsCommand;
548
+ const se_ListKnowledgeBasesCommand = async (input, context) => {
549
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
550
+ const headers = {};
551
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases";
552
+ const query = (0, smithy_client_1.map)({
553
+ nextToken: [, input.nextToken],
554
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
555
+ });
556
+ let body;
557
+ return new protocol_http_1.HttpRequest({
558
+ protocol,
559
+ hostname,
560
+ port,
561
+ method: "GET",
562
+ headers,
563
+ path: resolvedPath,
564
+ query,
565
+ body,
566
+ });
567
+ };
568
+ exports.se_ListKnowledgeBasesCommand = se_ListKnowledgeBasesCommand;
569
+ const se_ListQuickResponsesCommand = async (input, context) => {
570
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
571
+ const headers = {};
572
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
573
+ "/knowledgeBases/{knowledgeBaseId}/quickResponses";
574
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
575
+ const query = (0, smithy_client_1.map)({
576
+ nextToken: [, input.nextToken],
577
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
578
+ });
579
+ let body;
580
+ return new protocol_http_1.HttpRequest({
581
+ protocol,
582
+ hostname,
583
+ port,
584
+ method: "GET",
585
+ headers,
586
+ path: resolvedPath,
587
+ query,
588
+ body,
589
+ });
590
+ };
591
+ exports.se_ListQuickResponsesCommand = se_ListQuickResponsesCommand;
592
+ const se_ListTagsForResourceCommand = async (input, context) => {
593
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
594
+ const headers = {};
595
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
596
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
597
+ let body;
598
+ return new protocol_http_1.HttpRequest({
599
+ protocol,
600
+ hostname,
601
+ port,
602
+ method: "GET",
603
+ headers,
604
+ path: resolvedPath,
605
+ body,
606
+ });
607
+ };
608
+ exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
609
+ const se_NotifyRecommendationsReceivedCommand = async (input, context) => {
610
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
611
+ const headers = {
612
+ "content-type": "application/json",
613
+ };
614
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
615
+ "/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify";
616
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
617
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "sessionId", () => input.sessionId, "{sessionId}", false);
618
+ let body;
619
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
620
+ recommendationIds: (_) => (0, smithy_client_1._json)(_),
621
+ }));
622
+ return new protocol_http_1.HttpRequest({
623
+ protocol,
624
+ hostname,
625
+ port,
626
+ method: "POST",
627
+ headers,
628
+ path: resolvedPath,
629
+ body,
630
+ });
631
+ };
632
+ exports.se_NotifyRecommendationsReceivedCommand = se_NotifyRecommendationsReceivedCommand;
633
+ const se_QueryAssistantCommand = async (input, context) => {
634
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
635
+ const headers = {
636
+ "content-type": "application/json",
637
+ };
638
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/query";
639
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
640
+ let body;
641
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
642
+ maxResults: [],
643
+ nextToken: [],
644
+ queryCondition: (_) => (0, smithy_client_1._json)(_),
645
+ queryText: [],
646
+ sessionId: [],
647
+ }));
648
+ return new protocol_http_1.HttpRequest({
649
+ protocol,
650
+ hostname,
651
+ port,
652
+ method: "POST",
653
+ headers,
654
+ path: resolvedPath,
655
+ body,
656
+ });
657
+ };
658
+ exports.se_QueryAssistantCommand = se_QueryAssistantCommand;
659
+ const se_RemoveKnowledgeBaseTemplateUriCommand = async (input, context) => {
660
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
661
+ const headers = {};
662
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
663
+ "/knowledgeBases/{knowledgeBaseId}/templateUri";
664
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
665
+ let body;
666
+ return new protocol_http_1.HttpRequest({
667
+ protocol,
668
+ hostname,
669
+ port,
670
+ method: "DELETE",
671
+ headers,
672
+ path: resolvedPath,
673
+ body,
674
+ });
675
+ };
676
+ exports.se_RemoveKnowledgeBaseTemplateUriCommand = se_RemoveKnowledgeBaseTemplateUriCommand;
677
+ const se_SearchContentCommand = async (input, context) => {
678
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
679
+ const headers = {
680
+ "content-type": "application/json",
681
+ };
682
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}/search";
683
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
684
+ const query = (0, smithy_client_1.map)({
685
+ nextToken: [, input.nextToken],
686
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
687
+ });
688
+ let body;
689
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
690
+ searchExpression: (_) => (0, smithy_client_1._json)(_),
691
+ }));
692
+ return new protocol_http_1.HttpRequest({
693
+ protocol,
694
+ hostname,
695
+ port,
696
+ method: "POST",
697
+ headers,
698
+ path: resolvedPath,
699
+ query,
700
+ body,
701
+ });
702
+ };
703
+ exports.se_SearchContentCommand = se_SearchContentCommand;
704
+ const se_SearchQuickResponsesCommand = async (input, context) => {
705
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
706
+ const headers = {
707
+ "content-type": "application/json",
708
+ };
709
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
710
+ "/knowledgeBases/{knowledgeBaseId}/search/quickResponses";
711
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
712
+ const query = (0, smithy_client_1.map)({
713
+ nextToken: [, input.nextToken],
714
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
715
+ });
716
+ let body;
717
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
718
+ attributes: (_) => (0, smithy_client_1._json)(_),
719
+ searchExpression: (_) => (0, smithy_client_1._json)(_),
720
+ }));
721
+ return new protocol_http_1.HttpRequest({
722
+ protocol,
723
+ hostname,
724
+ port,
725
+ method: "POST",
726
+ headers,
727
+ path: resolvedPath,
728
+ query,
729
+ body,
730
+ });
731
+ };
732
+ exports.se_SearchQuickResponsesCommand = se_SearchQuickResponsesCommand;
733
+ const se_SearchSessionsCommand = async (input, context) => {
734
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
735
+ const headers = {
736
+ "content-type": "application/json",
737
+ };
738
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/searchSessions";
739
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "assistantId", () => input.assistantId, "{assistantId}", false);
740
+ const query = (0, smithy_client_1.map)({
741
+ nextToken: [, input.nextToken],
742
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
743
+ });
744
+ let body;
745
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
746
+ searchExpression: (_) => (0, smithy_client_1._json)(_),
747
+ }));
748
+ return new protocol_http_1.HttpRequest({
749
+ protocol,
750
+ hostname,
751
+ port,
752
+ method: "POST",
753
+ headers,
754
+ path: resolvedPath,
755
+ query,
756
+ body,
757
+ });
758
+ };
759
+ exports.se_SearchSessionsCommand = se_SearchSessionsCommand;
760
+ const se_StartContentUploadCommand = async (input, context) => {
761
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
762
+ const headers = {
763
+ "content-type": "application/json",
764
+ };
765
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/knowledgeBases/{knowledgeBaseId}/upload";
766
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
767
+ let body;
768
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
769
+ contentType: [],
770
+ presignedUrlTimeToLive: [],
771
+ }));
772
+ return new protocol_http_1.HttpRequest({
773
+ protocol,
774
+ hostname,
775
+ port,
776
+ method: "POST",
777
+ headers,
778
+ path: resolvedPath,
779
+ body,
780
+ });
781
+ };
782
+ exports.se_StartContentUploadCommand = se_StartContentUploadCommand;
783
+ const se_StartImportJobCommand = async (input, context) => {
784
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
785
+ const headers = {
786
+ "content-type": "application/json",
787
+ };
788
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
789
+ "/knowledgeBases/{knowledgeBaseId}/importJobs";
790
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
791
+ let body;
792
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
793
+ clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
794
+ externalSourceConfiguration: (_) => (0, smithy_client_1._json)(_),
795
+ importJobType: [],
796
+ metadata: (_) => (0, smithy_client_1._json)(_),
797
+ uploadId: [],
798
+ }));
799
+ return new protocol_http_1.HttpRequest({
800
+ protocol,
801
+ hostname,
802
+ port,
803
+ method: "POST",
804
+ headers,
805
+ path: resolvedPath,
806
+ body,
807
+ });
808
+ };
809
+ exports.se_StartImportJobCommand = se_StartImportJobCommand;
810
+ const se_TagResourceCommand = async (input, context) => {
811
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
812
+ const headers = {
813
+ "content-type": "application/json",
814
+ };
815
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
816
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
817
+ let body;
818
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
819
+ tags: (_) => (0, smithy_client_1._json)(_),
820
+ }));
821
+ return new protocol_http_1.HttpRequest({
822
+ protocol,
823
+ hostname,
824
+ port,
825
+ method: "POST",
826
+ headers,
827
+ path: resolvedPath,
828
+ body,
829
+ });
830
+ };
831
+ exports.se_TagResourceCommand = se_TagResourceCommand;
832
+ const se_UntagResourceCommand = async (input, context) => {
833
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
834
+ const headers = {};
835
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
836
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
837
+ const query = (0, smithy_client_1.map)({
838
+ tagKeys: [
839
+ (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
840
+ () => (input.tagKeys || []).map((_entry) => _entry),
841
+ ],
842
+ });
843
+ let body;
844
+ return new protocol_http_1.HttpRequest({
845
+ protocol,
846
+ hostname,
847
+ port,
848
+ method: "DELETE",
849
+ headers,
850
+ path: resolvedPath,
851
+ query,
852
+ body,
853
+ });
854
+ };
855
+ exports.se_UntagResourceCommand = se_UntagResourceCommand;
856
+ const se_UpdateContentCommand = async (input, context) => {
857
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
858
+ const headers = {
859
+ "content-type": "application/json",
860
+ };
861
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
862
+ "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}";
863
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
864
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "contentId", () => input.contentId, "{contentId}", false);
865
+ let body;
866
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
867
+ metadata: (_) => (0, smithy_client_1._json)(_),
868
+ overrideLinkOutUri: [],
869
+ removeOverrideLinkOutUri: [],
870
+ revisionId: [],
871
+ title: [],
872
+ uploadId: [],
873
+ }));
874
+ return new protocol_http_1.HttpRequest({
875
+ protocol,
876
+ hostname,
877
+ port,
878
+ method: "POST",
879
+ headers,
880
+ path: resolvedPath,
881
+ body,
882
+ });
883
+ };
884
+ exports.se_UpdateContentCommand = se_UpdateContentCommand;
885
+ const se_UpdateKnowledgeBaseTemplateUriCommand = async (input, context) => {
886
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
887
+ const headers = {
888
+ "content-type": "application/json",
889
+ };
890
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
891
+ "/knowledgeBases/{knowledgeBaseId}/templateUri";
892
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
893
+ let body;
894
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
895
+ templateUri: [],
896
+ }));
897
+ return new protocol_http_1.HttpRequest({
898
+ protocol,
899
+ hostname,
900
+ port,
901
+ method: "POST",
902
+ headers,
903
+ path: resolvedPath,
904
+ body,
905
+ });
906
+ };
907
+ exports.se_UpdateKnowledgeBaseTemplateUriCommand = se_UpdateKnowledgeBaseTemplateUriCommand;
908
+ const se_UpdateQuickResponseCommand = async (input, context) => {
909
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
910
+ const headers = {
911
+ "content-type": "application/json",
912
+ };
913
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
914
+ "/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}";
915
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
916
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "quickResponseId", () => input.quickResponseId, "{quickResponseId}", false);
917
+ let body;
918
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
919
+ channels: (_) => (0, smithy_client_1._json)(_),
920
+ content: (_) => (0, smithy_client_1._json)(_),
921
+ contentType: [],
922
+ description: [],
923
+ groupingConfiguration: (_) => (0, smithy_client_1._json)(_),
924
+ isActive: [],
925
+ language: [],
926
+ name: [],
927
+ removeDescription: [],
928
+ removeGroupingConfiguration: [],
929
+ removeShortcutKey: [],
930
+ shortcutKey: [],
931
+ }));
932
+ return new protocol_http_1.HttpRequest({
933
+ protocol,
934
+ hostname,
935
+ port,
936
+ method: "POST",
937
+ headers,
938
+ path: resolvedPath,
939
+ body,
940
+ });
941
+ };
942
+ exports.se_UpdateQuickResponseCommand = se_UpdateQuickResponseCommand;
943
+ const de_CreateAssistantCommand = async (output, context) => {
944
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
945
+ return de_CreateAssistantCommandError(output, context);
946
+ }
947
+ const contents = (0, smithy_client_1.map)({
948
+ $metadata: deserializeMetadata(output),
949
+ });
950
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
951
+ const doc = (0, smithy_client_1.take)(data, {
952
+ assistant: smithy_client_1._json,
953
+ });
954
+ Object.assign(contents, doc);
955
+ return contents;
956
+ };
957
+ exports.de_CreateAssistantCommand = de_CreateAssistantCommand;
958
+ const de_CreateAssistantCommandError = async (output, context) => {
959
+ const parsedOutput = {
960
+ ...output,
961
+ body: await parseErrorBody(output.body, context),
962
+ };
963
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
964
+ switch (errorCode) {
965
+ case "AccessDeniedException":
966
+ case "com.amazonaws.qconnect#AccessDeniedException":
967
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
968
+ case "ConflictException":
969
+ case "com.amazonaws.qconnect#ConflictException":
970
+ throw await de_ConflictExceptionRes(parsedOutput, context);
971
+ case "ServiceQuotaExceededException":
972
+ case "com.amazonaws.qconnect#ServiceQuotaExceededException":
973
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
974
+ case "ValidationException":
975
+ case "com.amazonaws.qconnect#ValidationException":
976
+ throw await de_ValidationExceptionRes(parsedOutput, context);
977
+ default:
978
+ const parsedBody = parsedOutput.body;
979
+ return throwDefaultError({
980
+ output,
981
+ parsedBody,
982
+ errorCode,
983
+ });
984
+ }
985
+ };
986
+ const de_CreateAssistantAssociationCommand = async (output, context) => {
987
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
988
+ return de_CreateAssistantAssociationCommandError(output, context);
989
+ }
990
+ const contents = (0, smithy_client_1.map)({
991
+ $metadata: deserializeMetadata(output),
992
+ });
993
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
994
+ const doc = (0, smithy_client_1.take)(data, {
995
+ assistantAssociation: smithy_client_1._json,
996
+ });
997
+ Object.assign(contents, doc);
998
+ return contents;
999
+ };
1000
+ exports.de_CreateAssistantAssociationCommand = de_CreateAssistantAssociationCommand;
1001
+ const de_CreateAssistantAssociationCommandError = async (output, context) => {
1002
+ const parsedOutput = {
1003
+ ...output,
1004
+ body: await parseErrorBody(output.body, context),
1005
+ };
1006
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1007
+ switch (errorCode) {
1008
+ case "AccessDeniedException":
1009
+ case "com.amazonaws.qconnect#AccessDeniedException":
1010
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1011
+ case "ConflictException":
1012
+ case "com.amazonaws.qconnect#ConflictException":
1013
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1014
+ case "ResourceNotFoundException":
1015
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1016
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1017
+ case "ServiceQuotaExceededException":
1018
+ case "com.amazonaws.qconnect#ServiceQuotaExceededException":
1019
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1020
+ case "ValidationException":
1021
+ case "com.amazonaws.qconnect#ValidationException":
1022
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1023
+ default:
1024
+ const parsedBody = parsedOutput.body;
1025
+ return throwDefaultError({
1026
+ output,
1027
+ parsedBody,
1028
+ errorCode,
1029
+ });
1030
+ }
1031
+ };
1032
+ const de_CreateContentCommand = async (output, context) => {
1033
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1034
+ return de_CreateContentCommandError(output, context);
1035
+ }
1036
+ const contents = (0, smithy_client_1.map)({
1037
+ $metadata: deserializeMetadata(output),
1038
+ });
1039
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1040
+ const doc = (0, smithy_client_1.take)(data, {
1041
+ content: (_) => de_ContentData(_, context),
1042
+ });
1043
+ Object.assign(contents, doc);
1044
+ return contents;
1045
+ };
1046
+ exports.de_CreateContentCommand = de_CreateContentCommand;
1047
+ const de_CreateContentCommandError = async (output, context) => {
1048
+ const parsedOutput = {
1049
+ ...output,
1050
+ body: await parseErrorBody(output.body, context),
1051
+ };
1052
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1053
+ switch (errorCode) {
1054
+ case "AccessDeniedException":
1055
+ case "com.amazonaws.qconnect#AccessDeniedException":
1056
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1057
+ case "ConflictException":
1058
+ case "com.amazonaws.qconnect#ConflictException":
1059
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1060
+ case "ResourceNotFoundException":
1061
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1062
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1063
+ case "ServiceQuotaExceededException":
1064
+ case "com.amazonaws.qconnect#ServiceQuotaExceededException":
1065
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1066
+ case "ValidationException":
1067
+ case "com.amazonaws.qconnect#ValidationException":
1068
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1069
+ default:
1070
+ const parsedBody = parsedOutput.body;
1071
+ return throwDefaultError({
1072
+ output,
1073
+ parsedBody,
1074
+ errorCode,
1075
+ });
1076
+ }
1077
+ };
1078
+ const de_CreateKnowledgeBaseCommand = async (output, context) => {
1079
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1080
+ return de_CreateKnowledgeBaseCommandError(output, context);
1081
+ }
1082
+ const contents = (0, smithy_client_1.map)({
1083
+ $metadata: deserializeMetadata(output),
1084
+ });
1085
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1086
+ const doc = (0, smithy_client_1.take)(data, {
1087
+ knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
1088
+ });
1089
+ Object.assign(contents, doc);
1090
+ return contents;
1091
+ };
1092
+ exports.de_CreateKnowledgeBaseCommand = de_CreateKnowledgeBaseCommand;
1093
+ const de_CreateKnowledgeBaseCommandError = async (output, context) => {
1094
+ const parsedOutput = {
1095
+ ...output,
1096
+ body: await parseErrorBody(output.body, context),
1097
+ };
1098
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1099
+ switch (errorCode) {
1100
+ case "AccessDeniedException":
1101
+ case "com.amazonaws.qconnect#AccessDeniedException":
1102
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1103
+ case "ConflictException":
1104
+ case "com.amazonaws.qconnect#ConflictException":
1105
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1106
+ case "ServiceQuotaExceededException":
1107
+ case "com.amazonaws.qconnect#ServiceQuotaExceededException":
1108
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1109
+ case "ValidationException":
1110
+ case "com.amazonaws.qconnect#ValidationException":
1111
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1112
+ default:
1113
+ const parsedBody = parsedOutput.body;
1114
+ return throwDefaultError({
1115
+ output,
1116
+ parsedBody,
1117
+ errorCode,
1118
+ });
1119
+ }
1120
+ };
1121
+ const de_CreateQuickResponseCommand = async (output, context) => {
1122
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1123
+ return de_CreateQuickResponseCommandError(output, context);
1124
+ }
1125
+ const contents = (0, smithy_client_1.map)({
1126
+ $metadata: deserializeMetadata(output),
1127
+ });
1128
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1129
+ const doc = (0, smithy_client_1.take)(data, {
1130
+ quickResponse: (_) => de_QuickResponseData(_, context),
1131
+ });
1132
+ Object.assign(contents, doc);
1133
+ return contents;
1134
+ };
1135
+ exports.de_CreateQuickResponseCommand = de_CreateQuickResponseCommand;
1136
+ const de_CreateQuickResponseCommandError = async (output, context) => {
1137
+ const parsedOutput = {
1138
+ ...output,
1139
+ body: await parseErrorBody(output.body, context),
1140
+ };
1141
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1142
+ switch (errorCode) {
1143
+ case "AccessDeniedException":
1144
+ case "com.amazonaws.qconnect#AccessDeniedException":
1145
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1146
+ case "ConflictException":
1147
+ case "com.amazonaws.qconnect#ConflictException":
1148
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1149
+ case "ResourceNotFoundException":
1150
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1151
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1152
+ case "ServiceQuotaExceededException":
1153
+ case "com.amazonaws.qconnect#ServiceQuotaExceededException":
1154
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1155
+ case "ValidationException":
1156
+ case "com.amazonaws.qconnect#ValidationException":
1157
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1158
+ default:
1159
+ const parsedBody = parsedOutput.body;
1160
+ return throwDefaultError({
1161
+ output,
1162
+ parsedBody,
1163
+ errorCode,
1164
+ });
1165
+ }
1166
+ };
1167
+ const de_CreateSessionCommand = async (output, context) => {
1168
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1169
+ return de_CreateSessionCommandError(output, context);
1170
+ }
1171
+ const contents = (0, smithy_client_1.map)({
1172
+ $metadata: deserializeMetadata(output),
1173
+ });
1174
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1175
+ const doc = (0, smithy_client_1.take)(data, {
1176
+ session: smithy_client_1._json,
1177
+ });
1178
+ Object.assign(contents, doc);
1179
+ return contents;
1180
+ };
1181
+ exports.de_CreateSessionCommand = de_CreateSessionCommand;
1182
+ const de_CreateSessionCommandError = async (output, context) => {
1183
+ const parsedOutput = {
1184
+ ...output,
1185
+ body: await parseErrorBody(output.body, context),
1186
+ };
1187
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1188
+ switch (errorCode) {
1189
+ case "ConflictException":
1190
+ case "com.amazonaws.qconnect#ConflictException":
1191
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1192
+ case "ResourceNotFoundException":
1193
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1194
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1195
+ case "ValidationException":
1196
+ case "com.amazonaws.qconnect#ValidationException":
1197
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1198
+ default:
1199
+ const parsedBody = parsedOutput.body;
1200
+ return throwDefaultError({
1201
+ output,
1202
+ parsedBody,
1203
+ errorCode,
1204
+ });
1205
+ }
1206
+ };
1207
+ const de_DeleteAssistantCommand = async (output, context) => {
1208
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1209
+ return de_DeleteAssistantCommandError(output, context);
1210
+ }
1211
+ const contents = (0, smithy_client_1.map)({
1212
+ $metadata: deserializeMetadata(output),
1213
+ });
1214
+ await (0, smithy_client_1.collectBody)(output.body, context);
1215
+ return contents;
1216
+ };
1217
+ exports.de_DeleteAssistantCommand = de_DeleteAssistantCommand;
1218
+ const de_DeleteAssistantCommandError = async (output, context) => {
1219
+ const parsedOutput = {
1220
+ ...output,
1221
+ body: await parseErrorBody(output.body, context),
1222
+ };
1223
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1224
+ switch (errorCode) {
1225
+ case "AccessDeniedException":
1226
+ case "com.amazonaws.qconnect#AccessDeniedException":
1227
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1228
+ case "ResourceNotFoundException":
1229
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1230
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1231
+ case "ValidationException":
1232
+ case "com.amazonaws.qconnect#ValidationException":
1233
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1234
+ default:
1235
+ const parsedBody = parsedOutput.body;
1236
+ return throwDefaultError({
1237
+ output,
1238
+ parsedBody,
1239
+ errorCode,
1240
+ });
1241
+ }
1242
+ };
1243
+ const de_DeleteAssistantAssociationCommand = async (output, context) => {
1244
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1245
+ return de_DeleteAssistantAssociationCommandError(output, context);
1246
+ }
1247
+ const contents = (0, smithy_client_1.map)({
1248
+ $metadata: deserializeMetadata(output),
1249
+ });
1250
+ await (0, smithy_client_1.collectBody)(output.body, context);
1251
+ return contents;
1252
+ };
1253
+ exports.de_DeleteAssistantAssociationCommand = de_DeleteAssistantAssociationCommand;
1254
+ const de_DeleteAssistantAssociationCommandError = async (output, context) => {
1255
+ const parsedOutput = {
1256
+ ...output,
1257
+ body: await parseErrorBody(output.body, context),
1258
+ };
1259
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1260
+ switch (errorCode) {
1261
+ case "AccessDeniedException":
1262
+ case "com.amazonaws.qconnect#AccessDeniedException":
1263
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1264
+ case "ResourceNotFoundException":
1265
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1266
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1267
+ case "ValidationException":
1268
+ case "com.amazonaws.qconnect#ValidationException":
1269
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1270
+ default:
1271
+ const parsedBody = parsedOutput.body;
1272
+ return throwDefaultError({
1273
+ output,
1274
+ parsedBody,
1275
+ errorCode,
1276
+ });
1277
+ }
1278
+ };
1279
+ const de_DeleteContentCommand = async (output, context) => {
1280
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1281
+ return de_DeleteContentCommandError(output, context);
1282
+ }
1283
+ const contents = (0, smithy_client_1.map)({
1284
+ $metadata: deserializeMetadata(output),
1285
+ });
1286
+ await (0, smithy_client_1.collectBody)(output.body, context);
1287
+ return contents;
1288
+ };
1289
+ exports.de_DeleteContentCommand = de_DeleteContentCommand;
1290
+ const de_DeleteContentCommandError = async (output, context) => {
1291
+ const parsedOutput = {
1292
+ ...output,
1293
+ body: await parseErrorBody(output.body, context),
1294
+ };
1295
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1296
+ switch (errorCode) {
1297
+ case "AccessDeniedException":
1298
+ case "com.amazonaws.qconnect#AccessDeniedException":
1299
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1300
+ case "ResourceNotFoundException":
1301
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1302
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1303
+ case "ValidationException":
1304
+ case "com.amazonaws.qconnect#ValidationException":
1305
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1306
+ default:
1307
+ const parsedBody = parsedOutput.body;
1308
+ return throwDefaultError({
1309
+ output,
1310
+ parsedBody,
1311
+ errorCode,
1312
+ });
1313
+ }
1314
+ };
1315
+ const de_DeleteImportJobCommand = async (output, context) => {
1316
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1317
+ return de_DeleteImportJobCommandError(output, context);
1318
+ }
1319
+ const contents = (0, smithy_client_1.map)({
1320
+ $metadata: deserializeMetadata(output),
1321
+ });
1322
+ await (0, smithy_client_1.collectBody)(output.body, context);
1323
+ return contents;
1324
+ };
1325
+ exports.de_DeleteImportJobCommand = de_DeleteImportJobCommand;
1326
+ const de_DeleteImportJobCommandError = async (output, context) => {
1327
+ const parsedOutput = {
1328
+ ...output,
1329
+ body: await parseErrorBody(output.body, context),
1330
+ };
1331
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1332
+ switch (errorCode) {
1333
+ case "AccessDeniedException":
1334
+ case "com.amazonaws.qconnect#AccessDeniedException":
1335
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1336
+ case "ConflictException":
1337
+ case "com.amazonaws.qconnect#ConflictException":
1338
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1339
+ case "ResourceNotFoundException":
1340
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1341
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1342
+ case "ValidationException":
1343
+ case "com.amazonaws.qconnect#ValidationException":
1344
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1345
+ default:
1346
+ const parsedBody = parsedOutput.body;
1347
+ return throwDefaultError({
1348
+ output,
1349
+ parsedBody,
1350
+ errorCode,
1351
+ });
1352
+ }
1353
+ };
1354
+ const de_DeleteKnowledgeBaseCommand = async (output, context) => {
1355
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1356
+ return de_DeleteKnowledgeBaseCommandError(output, context);
1357
+ }
1358
+ const contents = (0, smithy_client_1.map)({
1359
+ $metadata: deserializeMetadata(output),
1360
+ });
1361
+ await (0, smithy_client_1.collectBody)(output.body, context);
1362
+ return contents;
1363
+ };
1364
+ exports.de_DeleteKnowledgeBaseCommand = de_DeleteKnowledgeBaseCommand;
1365
+ const de_DeleteKnowledgeBaseCommandError = async (output, context) => {
1366
+ const parsedOutput = {
1367
+ ...output,
1368
+ body: await parseErrorBody(output.body, context),
1369
+ };
1370
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1371
+ switch (errorCode) {
1372
+ case "AccessDeniedException":
1373
+ case "com.amazonaws.qconnect#AccessDeniedException":
1374
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1375
+ case "ConflictException":
1376
+ case "com.amazonaws.qconnect#ConflictException":
1377
+ throw await de_ConflictExceptionRes(parsedOutput, context);
1378
+ case "ResourceNotFoundException":
1379
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1380
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1381
+ case "ValidationException":
1382
+ case "com.amazonaws.qconnect#ValidationException":
1383
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1384
+ default:
1385
+ const parsedBody = parsedOutput.body;
1386
+ return throwDefaultError({
1387
+ output,
1388
+ parsedBody,
1389
+ errorCode,
1390
+ });
1391
+ }
1392
+ };
1393
+ const de_DeleteQuickResponseCommand = async (output, context) => {
1394
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1395
+ return de_DeleteQuickResponseCommandError(output, context);
1396
+ }
1397
+ const contents = (0, smithy_client_1.map)({
1398
+ $metadata: deserializeMetadata(output),
1399
+ });
1400
+ await (0, smithy_client_1.collectBody)(output.body, context);
1401
+ return contents;
1402
+ };
1403
+ exports.de_DeleteQuickResponseCommand = de_DeleteQuickResponseCommand;
1404
+ const de_DeleteQuickResponseCommandError = async (output, context) => {
1405
+ const parsedOutput = {
1406
+ ...output,
1407
+ body: await parseErrorBody(output.body, context),
1408
+ };
1409
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1410
+ switch (errorCode) {
1411
+ case "AccessDeniedException":
1412
+ case "com.amazonaws.qconnect#AccessDeniedException":
1413
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1414
+ case "ResourceNotFoundException":
1415
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1416
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1417
+ case "ValidationException":
1418
+ case "com.amazonaws.qconnect#ValidationException":
1419
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1420
+ default:
1421
+ const parsedBody = parsedOutput.body;
1422
+ return throwDefaultError({
1423
+ output,
1424
+ parsedBody,
1425
+ errorCode,
1426
+ });
1427
+ }
1428
+ };
1429
+ const de_GetAssistantCommand = async (output, context) => {
1430
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1431
+ return de_GetAssistantCommandError(output, context);
1432
+ }
1433
+ const contents = (0, smithy_client_1.map)({
1434
+ $metadata: deserializeMetadata(output),
1435
+ });
1436
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1437
+ const doc = (0, smithy_client_1.take)(data, {
1438
+ assistant: smithy_client_1._json,
1439
+ });
1440
+ Object.assign(contents, doc);
1441
+ return contents;
1442
+ };
1443
+ exports.de_GetAssistantCommand = de_GetAssistantCommand;
1444
+ const de_GetAssistantCommandError = async (output, context) => {
1445
+ const parsedOutput = {
1446
+ ...output,
1447
+ body: await parseErrorBody(output.body, context),
1448
+ };
1449
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1450
+ switch (errorCode) {
1451
+ case "AccessDeniedException":
1452
+ case "com.amazonaws.qconnect#AccessDeniedException":
1453
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1454
+ case "ResourceNotFoundException":
1455
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1456
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1457
+ case "ValidationException":
1458
+ case "com.amazonaws.qconnect#ValidationException":
1459
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1460
+ default:
1461
+ const parsedBody = parsedOutput.body;
1462
+ return throwDefaultError({
1463
+ output,
1464
+ parsedBody,
1465
+ errorCode,
1466
+ });
1467
+ }
1468
+ };
1469
+ const de_GetAssistantAssociationCommand = async (output, context) => {
1470
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1471
+ return de_GetAssistantAssociationCommandError(output, context);
1472
+ }
1473
+ const contents = (0, smithy_client_1.map)({
1474
+ $metadata: deserializeMetadata(output),
1475
+ });
1476
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1477
+ const doc = (0, smithy_client_1.take)(data, {
1478
+ assistantAssociation: smithy_client_1._json,
1479
+ });
1480
+ Object.assign(contents, doc);
1481
+ return contents;
1482
+ };
1483
+ exports.de_GetAssistantAssociationCommand = de_GetAssistantAssociationCommand;
1484
+ const de_GetAssistantAssociationCommandError = async (output, context) => {
1485
+ const parsedOutput = {
1486
+ ...output,
1487
+ body: await parseErrorBody(output.body, context),
1488
+ };
1489
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1490
+ switch (errorCode) {
1491
+ case "AccessDeniedException":
1492
+ case "com.amazonaws.qconnect#AccessDeniedException":
1493
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1494
+ case "ResourceNotFoundException":
1495
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1496
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1497
+ case "ValidationException":
1498
+ case "com.amazonaws.qconnect#ValidationException":
1499
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1500
+ default:
1501
+ const parsedBody = parsedOutput.body;
1502
+ return throwDefaultError({
1503
+ output,
1504
+ parsedBody,
1505
+ errorCode,
1506
+ });
1507
+ }
1508
+ };
1509
+ const de_GetContentCommand = async (output, context) => {
1510
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1511
+ return de_GetContentCommandError(output, context);
1512
+ }
1513
+ const contents = (0, smithy_client_1.map)({
1514
+ $metadata: deserializeMetadata(output),
1515
+ });
1516
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1517
+ const doc = (0, smithy_client_1.take)(data, {
1518
+ content: (_) => de_ContentData(_, context),
1519
+ });
1520
+ Object.assign(contents, doc);
1521
+ return contents;
1522
+ };
1523
+ exports.de_GetContentCommand = de_GetContentCommand;
1524
+ const de_GetContentCommandError = async (output, context) => {
1525
+ const parsedOutput = {
1526
+ ...output,
1527
+ body: await parseErrorBody(output.body, context),
1528
+ };
1529
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1530
+ switch (errorCode) {
1531
+ case "AccessDeniedException":
1532
+ case "com.amazonaws.qconnect#AccessDeniedException":
1533
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1534
+ case "ResourceNotFoundException":
1535
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1536
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1537
+ case "ValidationException":
1538
+ case "com.amazonaws.qconnect#ValidationException":
1539
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1540
+ default:
1541
+ const parsedBody = parsedOutput.body;
1542
+ return throwDefaultError({
1543
+ output,
1544
+ parsedBody,
1545
+ errorCode,
1546
+ });
1547
+ }
1548
+ };
1549
+ const de_GetContentSummaryCommand = async (output, context) => {
1550
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1551
+ return de_GetContentSummaryCommandError(output, context);
1552
+ }
1553
+ const contents = (0, smithy_client_1.map)({
1554
+ $metadata: deserializeMetadata(output),
1555
+ });
1556
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1557
+ const doc = (0, smithy_client_1.take)(data, {
1558
+ contentSummary: smithy_client_1._json,
1559
+ });
1560
+ Object.assign(contents, doc);
1561
+ return contents;
1562
+ };
1563
+ exports.de_GetContentSummaryCommand = de_GetContentSummaryCommand;
1564
+ const de_GetContentSummaryCommandError = async (output, context) => {
1565
+ const parsedOutput = {
1566
+ ...output,
1567
+ body: await parseErrorBody(output.body, context),
1568
+ };
1569
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1570
+ switch (errorCode) {
1571
+ case "AccessDeniedException":
1572
+ case "com.amazonaws.qconnect#AccessDeniedException":
1573
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1574
+ case "ResourceNotFoundException":
1575
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1576
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1577
+ case "ValidationException":
1578
+ case "com.amazonaws.qconnect#ValidationException":
1579
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1580
+ default:
1581
+ const parsedBody = parsedOutput.body;
1582
+ return throwDefaultError({
1583
+ output,
1584
+ parsedBody,
1585
+ errorCode,
1586
+ });
1587
+ }
1588
+ };
1589
+ const de_GetImportJobCommand = async (output, context) => {
1590
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1591
+ return de_GetImportJobCommandError(output, context);
1592
+ }
1593
+ const contents = (0, smithy_client_1.map)({
1594
+ $metadata: deserializeMetadata(output),
1595
+ });
1596
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1597
+ const doc = (0, smithy_client_1.take)(data, {
1598
+ importJob: (_) => de_ImportJobData(_, context),
1599
+ });
1600
+ Object.assign(contents, doc);
1601
+ return contents;
1602
+ };
1603
+ exports.de_GetImportJobCommand = de_GetImportJobCommand;
1604
+ const de_GetImportJobCommandError = async (output, context) => {
1605
+ const parsedOutput = {
1606
+ ...output,
1607
+ body: await parseErrorBody(output.body, context),
1608
+ };
1609
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1610
+ switch (errorCode) {
1611
+ case "AccessDeniedException":
1612
+ case "com.amazonaws.qconnect#AccessDeniedException":
1613
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1614
+ case "ResourceNotFoundException":
1615
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1616
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1617
+ case "ValidationException":
1618
+ case "com.amazonaws.qconnect#ValidationException":
1619
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1620
+ default:
1621
+ const parsedBody = parsedOutput.body;
1622
+ return throwDefaultError({
1623
+ output,
1624
+ parsedBody,
1625
+ errorCode,
1626
+ });
1627
+ }
1628
+ };
1629
+ const de_GetKnowledgeBaseCommand = async (output, context) => {
1630
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1631
+ return de_GetKnowledgeBaseCommandError(output, context);
1632
+ }
1633
+ const contents = (0, smithy_client_1.map)({
1634
+ $metadata: deserializeMetadata(output),
1635
+ });
1636
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1637
+ const doc = (0, smithy_client_1.take)(data, {
1638
+ knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
1639
+ });
1640
+ Object.assign(contents, doc);
1641
+ return contents;
1642
+ };
1643
+ exports.de_GetKnowledgeBaseCommand = de_GetKnowledgeBaseCommand;
1644
+ const de_GetKnowledgeBaseCommandError = async (output, context) => {
1645
+ const parsedOutput = {
1646
+ ...output,
1647
+ body: await parseErrorBody(output.body, context),
1648
+ };
1649
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1650
+ switch (errorCode) {
1651
+ case "AccessDeniedException":
1652
+ case "com.amazonaws.qconnect#AccessDeniedException":
1653
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1654
+ case "ResourceNotFoundException":
1655
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1656
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1657
+ case "ValidationException":
1658
+ case "com.amazonaws.qconnect#ValidationException":
1659
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1660
+ default:
1661
+ const parsedBody = parsedOutput.body;
1662
+ return throwDefaultError({
1663
+ output,
1664
+ parsedBody,
1665
+ errorCode,
1666
+ });
1667
+ }
1668
+ };
1669
+ const de_GetQuickResponseCommand = async (output, context) => {
1670
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1671
+ return de_GetQuickResponseCommandError(output, context);
1672
+ }
1673
+ const contents = (0, smithy_client_1.map)({
1674
+ $metadata: deserializeMetadata(output),
1675
+ });
1676
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1677
+ const doc = (0, smithy_client_1.take)(data, {
1678
+ quickResponse: (_) => de_QuickResponseData(_, context),
1679
+ });
1680
+ Object.assign(contents, doc);
1681
+ return contents;
1682
+ };
1683
+ exports.de_GetQuickResponseCommand = de_GetQuickResponseCommand;
1684
+ const de_GetQuickResponseCommandError = async (output, context) => {
1685
+ const parsedOutput = {
1686
+ ...output,
1687
+ body: await parseErrorBody(output.body, context),
1688
+ };
1689
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1690
+ switch (errorCode) {
1691
+ case "AccessDeniedException":
1692
+ case "com.amazonaws.qconnect#AccessDeniedException":
1693
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1694
+ case "ResourceNotFoundException":
1695
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1696
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1697
+ case "ValidationException":
1698
+ case "com.amazonaws.qconnect#ValidationException":
1699
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1700
+ default:
1701
+ const parsedBody = parsedOutput.body;
1702
+ return throwDefaultError({
1703
+ output,
1704
+ parsedBody,
1705
+ errorCode,
1706
+ });
1707
+ }
1708
+ };
1709
+ const de_GetRecommendationsCommand = async (output, context) => {
1710
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1711
+ return de_GetRecommendationsCommandError(output, context);
1712
+ }
1713
+ const contents = (0, smithy_client_1.map)({
1714
+ $metadata: deserializeMetadata(output),
1715
+ });
1716
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1717
+ const doc = (0, smithy_client_1.take)(data, {
1718
+ recommendations: (_) => de_RecommendationList(_, context),
1719
+ triggers: smithy_client_1._json,
1720
+ });
1721
+ Object.assign(contents, doc);
1722
+ return contents;
1723
+ };
1724
+ exports.de_GetRecommendationsCommand = de_GetRecommendationsCommand;
1725
+ const de_GetRecommendationsCommandError = async (output, context) => {
1726
+ const parsedOutput = {
1727
+ ...output,
1728
+ body: await parseErrorBody(output.body, context),
1729
+ };
1730
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1731
+ switch (errorCode) {
1732
+ case "AccessDeniedException":
1733
+ case "com.amazonaws.qconnect#AccessDeniedException":
1734
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1735
+ case "ResourceNotFoundException":
1736
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1737
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1738
+ case "ValidationException":
1739
+ case "com.amazonaws.qconnect#ValidationException":
1740
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1741
+ default:
1742
+ const parsedBody = parsedOutput.body;
1743
+ return throwDefaultError({
1744
+ output,
1745
+ parsedBody,
1746
+ errorCode,
1747
+ });
1748
+ }
1749
+ };
1750
+ const de_GetSessionCommand = async (output, context) => {
1751
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1752
+ return de_GetSessionCommandError(output, context);
1753
+ }
1754
+ const contents = (0, smithy_client_1.map)({
1755
+ $metadata: deserializeMetadata(output),
1756
+ });
1757
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1758
+ const doc = (0, smithy_client_1.take)(data, {
1759
+ session: smithy_client_1._json,
1760
+ });
1761
+ Object.assign(contents, doc);
1762
+ return contents;
1763
+ };
1764
+ exports.de_GetSessionCommand = de_GetSessionCommand;
1765
+ const de_GetSessionCommandError = async (output, context) => {
1766
+ const parsedOutput = {
1767
+ ...output,
1768
+ body: await parseErrorBody(output.body, context),
1769
+ };
1770
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1771
+ switch (errorCode) {
1772
+ case "AccessDeniedException":
1773
+ case "com.amazonaws.qconnect#AccessDeniedException":
1774
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1775
+ case "ResourceNotFoundException":
1776
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1777
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1778
+ case "ValidationException":
1779
+ case "com.amazonaws.qconnect#ValidationException":
1780
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1781
+ default:
1782
+ const parsedBody = parsedOutput.body;
1783
+ return throwDefaultError({
1784
+ output,
1785
+ parsedBody,
1786
+ errorCode,
1787
+ });
1788
+ }
1789
+ };
1790
+ const de_ListAssistantAssociationsCommand = async (output, context) => {
1791
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1792
+ return de_ListAssistantAssociationsCommandError(output, context);
1793
+ }
1794
+ const contents = (0, smithy_client_1.map)({
1795
+ $metadata: deserializeMetadata(output),
1796
+ });
1797
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1798
+ const doc = (0, smithy_client_1.take)(data, {
1799
+ assistantAssociationSummaries: smithy_client_1._json,
1800
+ nextToken: smithy_client_1.expectString,
1801
+ });
1802
+ Object.assign(contents, doc);
1803
+ return contents;
1804
+ };
1805
+ exports.de_ListAssistantAssociationsCommand = de_ListAssistantAssociationsCommand;
1806
+ const de_ListAssistantAssociationsCommandError = async (output, context) => {
1807
+ const parsedOutput = {
1808
+ ...output,
1809
+ body: await parseErrorBody(output.body, context),
1810
+ };
1811
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1812
+ switch (errorCode) {
1813
+ case "AccessDeniedException":
1814
+ case "com.amazonaws.qconnect#AccessDeniedException":
1815
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1816
+ case "ResourceNotFoundException":
1817
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1818
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1819
+ case "ValidationException":
1820
+ case "com.amazonaws.qconnect#ValidationException":
1821
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1822
+ default:
1823
+ const parsedBody = parsedOutput.body;
1824
+ return throwDefaultError({
1825
+ output,
1826
+ parsedBody,
1827
+ errorCode,
1828
+ });
1829
+ }
1830
+ };
1831
+ const de_ListAssistantsCommand = async (output, context) => {
1832
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1833
+ return de_ListAssistantsCommandError(output, context);
1834
+ }
1835
+ const contents = (0, smithy_client_1.map)({
1836
+ $metadata: deserializeMetadata(output),
1837
+ });
1838
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1839
+ const doc = (0, smithy_client_1.take)(data, {
1840
+ assistantSummaries: smithy_client_1._json,
1841
+ nextToken: smithy_client_1.expectString,
1842
+ });
1843
+ Object.assign(contents, doc);
1844
+ return contents;
1845
+ };
1846
+ exports.de_ListAssistantsCommand = de_ListAssistantsCommand;
1847
+ const de_ListAssistantsCommandError = async (output, context) => {
1848
+ const parsedOutput = {
1849
+ ...output,
1850
+ body: await parseErrorBody(output.body, context),
1851
+ };
1852
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1853
+ switch (errorCode) {
1854
+ case "AccessDeniedException":
1855
+ case "com.amazonaws.qconnect#AccessDeniedException":
1856
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1857
+ case "ValidationException":
1858
+ case "com.amazonaws.qconnect#ValidationException":
1859
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1860
+ default:
1861
+ const parsedBody = parsedOutput.body;
1862
+ return throwDefaultError({
1863
+ output,
1864
+ parsedBody,
1865
+ errorCode,
1866
+ });
1867
+ }
1868
+ };
1869
+ const de_ListContentsCommand = async (output, context) => {
1870
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1871
+ return de_ListContentsCommandError(output, context);
1872
+ }
1873
+ const contents = (0, smithy_client_1.map)({
1874
+ $metadata: deserializeMetadata(output),
1875
+ });
1876
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1877
+ const doc = (0, smithy_client_1.take)(data, {
1878
+ contentSummaries: smithy_client_1._json,
1879
+ nextToken: smithy_client_1.expectString,
1880
+ });
1881
+ Object.assign(contents, doc);
1882
+ return contents;
1883
+ };
1884
+ exports.de_ListContentsCommand = de_ListContentsCommand;
1885
+ const de_ListContentsCommandError = async (output, context) => {
1886
+ const parsedOutput = {
1887
+ ...output,
1888
+ body: await parseErrorBody(output.body, context),
1889
+ };
1890
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1891
+ switch (errorCode) {
1892
+ case "AccessDeniedException":
1893
+ case "com.amazonaws.qconnect#AccessDeniedException":
1894
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1895
+ case "ResourceNotFoundException":
1896
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
1897
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1898
+ case "ValidationException":
1899
+ case "com.amazonaws.qconnect#ValidationException":
1900
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1901
+ default:
1902
+ const parsedBody = parsedOutput.body;
1903
+ return throwDefaultError({
1904
+ output,
1905
+ parsedBody,
1906
+ errorCode,
1907
+ });
1908
+ }
1909
+ };
1910
+ const de_ListImportJobsCommand = async (output, context) => {
1911
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1912
+ return de_ListImportJobsCommandError(output, context);
1913
+ }
1914
+ const contents = (0, smithy_client_1.map)({
1915
+ $metadata: deserializeMetadata(output),
1916
+ });
1917
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1918
+ const doc = (0, smithy_client_1.take)(data, {
1919
+ importJobSummaries: (_) => de_ImportJobList(_, context),
1920
+ nextToken: smithy_client_1.expectString,
1921
+ });
1922
+ Object.assign(contents, doc);
1923
+ return contents;
1924
+ };
1925
+ exports.de_ListImportJobsCommand = de_ListImportJobsCommand;
1926
+ const de_ListImportJobsCommandError = async (output, context) => {
1927
+ const parsedOutput = {
1928
+ ...output,
1929
+ body: await parseErrorBody(output.body, context),
1930
+ };
1931
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1932
+ switch (errorCode) {
1933
+ case "AccessDeniedException":
1934
+ case "com.amazonaws.qconnect#AccessDeniedException":
1935
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1936
+ case "ValidationException":
1937
+ case "com.amazonaws.qconnect#ValidationException":
1938
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1939
+ default:
1940
+ const parsedBody = parsedOutput.body;
1941
+ return throwDefaultError({
1942
+ output,
1943
+ parsedBody,
1944
+ errorCode,
1945
+ });
1946
+ }
1947
+ };
1948
+ const de_ListKnowledgeBasesCommand = async (output, context) => {
1949
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1950
+ return de_ListKnowledgeBasesCommandError(output, context);
1951
+ }
1952
+ const contents = (0, smithy_client_1.map)({
1953
+ $metadata: deserializeMetadata(output),
1954
+ });
1955
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1956
+ const doc = (0, smithy_client_1.take)(data, {
1957
+ knowledgeBaseSummaries: smithy_client_1._json,
1958
+ nextToken: smithy_client_1.expectString,
1959
+ });
1960
+ Object.assign(contents, doc);
1961
+ return contents;
1962
+ };
1963
+ exports.de_ListKnowledgeBasesCommand = de_ListKnowledgeBasesCommand;
1964
+ const de_ListKnowledgeBasesCommandError = async (output, context) => {
1965
+ const parsedOutput = {
1966
+ ...output,
1967
+ body: await parseErrorBody(output.body, context),
1968
+ };
1969
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1970
+ switch (errorCode) {
1971
+ case "AccessDeniedException":
1972
+ case "com.amazonaws.qconnect#AccessDeniedException":
1973
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1974
+ case "ValidationException":
1975
+ case "com.amazonaws.qconnect#ValidationException":
1976
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1977
+ default:
1978
+ const parsedBody = parsedOutput.body;
1979
+ return throwDefaultError({
1980
+ output,
1981
+ parsedBody,
1982
+ errorCode,
1983
+ });
1984
+ }
1985
+ };
1986
+ const de_ListQuickResponsesCommand = async (output, context) => {
1987
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1988
+ return de_ListQuickResponsesCommandError(output, context);
1989
+ }
1990
+ const contents = (0, smithy_client_1.map)({
1991
+ $metadata: deserializeMetadata(output),
1992
+ });
1993
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1994
+ const doc = (0, smithy_client_1.take)(data, {
1995
+ nextToken: smithy_client_1.expectString,
1996
+ quickResponseSummaries: (_) => de_QuickResponseSummaryList(_, context),
1997
+ });
1998
+ Object.assign(contents, doc);
1999
+ return contents;
2000
+ };
2001
+ exports.de_ListQuickResponsesCommand = de_ListQuickResponsesCommand;
2002
+ const de_ListQuickResponsesCommandError = async (output, context) => {
2003
+ const parsedOutput = {
2004
+ ...output,
2005
+ body: await parseErrorBody(output.body, context),
2006
+ };
2007
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2008
+ switch (errorCode) {
2009
+ case "AccessDeniedException":
2010
+ case "com.amazonaws.qconnect#AccessDeniedException":
2011
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2012
+ case "ResourceNotFoundException":
2013
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2014
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2015
+ case "ValidationException":
2016
+ case "com.amazonaws.qconnect#ValidationException":
2017
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2018
+ default:
2019
+ const parsedBody = parsedOutput.body;
2020
+ return throwDefaultError({
2021
+ output,
2022
+ parsedBody,
2023
+ errorCode,
2024
+ });
2025
+ }
2026
+ };
2027
+ const de_ListTagsForResourceCommand = async (output, context) => {
2028
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2029
+ return de_ListTagsForResourceCommandError(output, context);
2030
+ }
2031
+ const contents = (0, smithy_client_1.map)({
2032
+ $metadata: deserializeMetadata(output),
2033
+ });
2034
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2035
+ const doc = (0, smithy_client_1.take)(data, {
2036
+ tags: smithy_client_1._json,
2037
+ });
2038
+ Object.assign(contents, doc);
2039
+ return contents;
2040
+ };
2041
+ exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
2042
+ const de_ListTagsForResourceCommandError = async (output, context) => {
2043
+ const parsedOutput = {
2044
+ ...output,
2045
+ body: await parseErrorBody(output.body, context),
2046
+ };
2047
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2048
+ switch (errorCode) {
2049
+ case "ResourceNotFoundException":
2050
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2051
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2052
+ default:
2053
+ const parsedBody = parsedOutput.body;
2054
+ return throwDefaultError({
2055
+ output,
2056
+ parsedBody,
2057
+ errorCode,
2058
+ });
2059
+ }
2060
+ };
2061
+ const de_NotifyRecommendationsReceivedCommand = async (output, context) => {
2062
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2063
+ return de_NotifyRecommendationsReceivedCommandError(output, context);
2064
+ }
2065
+ const contents = (0, smithy_client_1.map)({
2066
+ $metadata: deserializeMetadata(output),
2067
+ });
2068
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2069
+ const doc = (0, smithy_client_1.take)(data, {
2070
+ errors: smithy_client_1._json,
2071
+ recommendationIds: smithy_client_1._json,
2072
+ });
2073
+ Object.assign(contents, doc);
2074
+ return contents;
2075
+ };
2076
+ exports.de_NotifyRecommendationsReceivedCommand = de_NotifyRecommendationsReceivedCommand;
2077
+ const de_NotifyRecommendationsReceivedCommandError = async (output, context) => {
2078
+ const parsedOutput = {
2079
+ ...output,
2080
+ body: await parseErrorBody(output.body, context),
2081
+ };
2082
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2083
+ switch (errorCode) {
2084
+ case "AccessDeniedException":
2085
+ case "com.amazonaws.qconnect#AccessDeniedException":
2086
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2087
+ case "ResourceNotFoundException":
2088
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2089
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2090
+ case "ValidationException":
2091
+ case "com.amazonaws.qconnect#ValidationException":
2092
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2093
+ default:
2094
+ const parsedBody = parsedOutput.body;
2095
+ return throwDefaultError({
2096
+ output,
2097
+ parsedBody,
2098
+ errorCode,
2099
+ });
2100
+ }
2101
+ };
2102
+ const de_QueryAssistantCommand = async (output, context) => {
2103
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2104
+ return de_QueryAssistantCommandError(output, context);
2105
+ }
2106
+ const contents = (0, smithy_client_1.map)({
2107
+ $metadata: deserializeMetadata(output),
2108
+ });
2109
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2110
+ const doc = (0, smithy_client_1.take)(data, {
2111
+ nextToken: smithy_client_1.expectString,
2112
+ results: (_) => de_QueryResultsList(_, context),
2113
+ });
2114
+ Object.assign(contents, doc);
2115
+ return contents;
2116
+ };
2117
+ exports.de_QueryAssistantCommand = de_QueryAssistantCommand;
2118
+ const de_QueryAssistantCommandError = async (output, context) => {
2119
+ const parsedOutput = {
2120
+ ...output,
2121
+ body: await parseErrorBody(output.body, context),
2122
+ };
2123
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2124
+ switch (errorCode) {
2125
+ case "AccessDeniedException":
2126
+ case "com.amazonaws.qconnect#AccessDeniedException":
2127
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2128
+ case "RequestTimeoutException":
2129
+ case "com.amazonaws.qconnect#RequestTimeoutException":
2130
+ throw await de_RequestTimeoutExceptionRes(parsedOutput, context);
2131
+ case "ResourceNotFoundException":
2132
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2133
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2134
+ case "ValidationException":
2135
+ case "com.amazonaws.qconnect#ValidationException":
2136
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2137
+ default:
2138
+ const parsedBody = parsedOutput.body;
2139
+ return throwDefaultError({
2140
+ output,
2141
+ parsedBody,
2142
+ errorCode,
2143
+ });
2144
+ }
2145
+ };
2146
+ const de_RemoveKnowledgeBaseTemplateUriCommand = async (output, context) => {
2147
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
2148
+ return de_RemoveKnowledgeBaseTemplateUriCommandError(output, context);
2149
+ }
2150
+ const contents = (0, smithy_client_1.map)({
2151
+ $metadata: deserializeMetadata(output),
2152
+ });
2153
+ await (0, smithy_client_1.collectBody)(output.body, context);
2154
+ return contents;
2155
+ };
2156
+ exports.de_RemoveKnowledgeBaseTemplateUriCommand = de_RemoveKnowledgeBaseTemplateUriCommand;
2157
+ const de_RemoveKnowledgeBaseTemplateUriCommandError = async (output, context) => {
2158
+ const parsedOutput = {
2159
+ ...output,
2160
+ body: await parseErrorBody(output.body, context),
2161
+ };
2162
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2163
+ switch (errorCode) {
2164
+ case "AccessDeniedException":
2165
+ case "com.amazonaws.qconnect#AccessDeniedException":
2166
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2167
+ case "ResourceNotFoundException":
2168
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2169
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2170
+ case "ValidationException":
2171
+ case "com.amazonaws.qconnect#ValidationException":
2172
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2173
+ default:
2174
+ const parsedBody = parsedOutput.body;
2175
+ return throwDefaultError({
2176
+ output,
2177
+ parsedBody,
2178
+ errorCode,
2179
+ });
2180
+ }
2181
+ };
2182
+ const de_SearchContentCommand = async (output, context) => {
2183
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2184
+ return de_SearchContentCommandError(output, context);
2185
+ }
2186
+ const contents = (0, smithy_client_1.map)({
2187
+ $metadata: deserializeMetadata(output),
2188
+ });
2189
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2190
+ const doc = (0, smithy_client_1.take)(data, {
2191
+ contentSummaries: smithy_client_1._json,
2192
+ nextToken: smithy_client_1.expectString,
2193
+ });
2194
+ Object.assign(contents, doc);
2195
+ return contents;
2196
+ };
2197
+ exports.de_SearchContentCommand = de_SearchContentCommand;
2198
+ const de_SearchContentCommandError = async (output, context) => {
2199
+ const parsedOutput = {
2200
+ ...output,
2201
+ body: await parseErrorBody(output.body, context),
2202
+ };
2203
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2204
+ switch (errorCode) {
2205
+ case "AccessDeniedException":
2206
+ case "com.amazonaws.qconnect#AccessDeniedException":
2207
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2208
+ case "ResourceNotFoundException":
2209
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2210
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2211
+ case "ValidationException":
2212
+ case "com.amazonaws.qconnect#ValidationException":
2213
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2214
+ default:
2215
+ const parsedBody = parsedOutput.body;
2216
+ return throwDefaultError({
2217
+ output,
2218
+ parsedBody,
2219
+ errorCode,
2220
+ });
2221
+ }
2222
+ };
2223
+ const de_SearchQuickResponsesCommand = async (output, context) => {
2224
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2225
+ return de_SearchQuickResponsesCommandError(output, context);
2226
+ }
2227
+ const contents = (0, smithy_client_1.map)({
2228
+ $metadata: deserializeMetadata(output),
2229
+ });
2230
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2231
+ const doc = (0, smithy_client_1.take)(data, {
2232
+ nextToken: smithy_client_1.expectString,
2233
+ results: (_) => de_QuickResponseSearchResultsList(_, context),
2234
+ });
2235
+ Object.assign(contents, doc);
2236
+ return contents;
2237
+ };
2238
+ exports.de_SearchQuickResponsesCommand = de_SearchQuickResponsesCommand;
2239
+ const de_SearchQuickResponsesCommandError = async (output, context) => {
2240
+ const parsedOutput = {
2241
+ ...output,
2242
+ body: await parseErrorBody(output.body, context),
2243
+ };
2244
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2245
+ switch (errorCode) {
2246
+ case "AccessDeniedException":
2247
+ case "com.amazonaws.qconnect#AccessDeniedException":
2248
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2249
+ case "RequestTimeoutException":
2250
+ case "com.amazonaws.qconnect#RequestTimeoutException":
2251
+ throw await de_RequestTimeoutExceptionRes(parsedOutput, context);
2252
+ case "ResourceNotFoundException":
2253
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2254
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2255
+ case "ValidationException":
2256
+ case "com.amazonaws.qconnect#ValidationException":
2257
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2258
+ default:
2259
+ const parsedBody = parsedOutput.body;
2260
+ return throwDefaultError({
2261
+ output,
2262
+ parsedBody,
2263
+ errorCode,
2264
+ });
2265
+ }
2266
+ };
2267
+ const de_SearchSessionsCommand = async (output, context) => {
2268
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2269
+ return de_SearchSessionsCommandError(output, context);
2270
+ }
2271
+ const contents = (0, smithy_client_1.map)({
2272
+ $metadata: deserializeMetadata(output),
2273
+ });
2274
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2275
+ const doc = (0, smithy_client_1.take)(data, {
2276
+ nextToken: smithy_client_1.expectString,
2277
+ sessionSummaries: smithy_client_1._json,
2278
+ });
2279
+ Object.assign(contents, doc);
2280
+ return contents;
2281
+ };
2282
+ exports.de_SearchSessionsCommand = de_SearchSessionsCommand;
2283
+ const de_SearchSessionsCommandError = async (output, context) => {
2284
+ const parsedOutput = {
2285
+ ...output,
2286
+ body: await parseErrorBody(output.body, context),
2287
+ };
2288
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2289
+ switch (errorCode) {
2290
+ case "AccessDeniedException":
2291
+ case "com.amazonaws.qconnect#AccessDeniedException":
2292
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2293
+ case "ResourceNotFoundException":
2294
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2295
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2296
+ case "ValidationException":
2297
+ case "com.amazonaws.qconnect#ValidationException":
2298
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2299
+ default:
2300
+ const parsedBody = parsedOutput.body;
2301
+ return throwDefaultError({
2302
+ output,
2303
+ parsedBody,
2304
+ errorCode,
2305
+ });
2306
+ }
2307
+ };
2308
+ const de_StartContentUploadCommand = async (output, context) => {
2309
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2310
+ return de_StartContentUploadCommandError(output, context);
2311
+ }
2312
+ const contents = (0, smithy_client_1.map)({
2313
+ $metadata: deserializeMetadata(output),
2314
+ });
2315
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2316
+ const doc = (0, smithy_client_1.take)(data, {
2317
+ headersToInclude: smithy_client_1._json,
2318
+ uploadId: smithy_client_1.expectString,
2319
+ url: smithy_client_1.expectString,
2320
+ urlExpiry: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2321
+ });
2322
+ Object.assign(contents, doc);
2323
+ return contents;
2324
+ };
2325
+ exports.de_StartContentUploadCommand = de_StartContentUploadCommand;
2326
+ const de_StartContentUploadCommandError = async (output, context) => {
2327
+ const parsedOutput = {
2328
+ ...output,
2329
+ body: await parseErrorBody(output.body, context),
2330
+ };
2331
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2332
+ switch (errorCode) {
2333
+ case "AccessDeniedException":
2334
+ case "com.amazonaws.qconnect#AccessDeniedException":
2335
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2336
+ case "ResourceNotFoundException":
2337
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2338
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2339
+ case "ValidationException":
2340
+ case "com.amazonaws.qconnect#ValidationException":
2341
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2342
+ default:
2343
+ const parsedBody = parsedOutput.body;
2344
+ return throwDefaultError({
2345
+ output,
2346
+ parsedBody,
2347
+ errorCode,
2348
+ });
2349
+ }
2350
+ };
2351
+ const de_StartImportJobCommand = async (output, context) => {
2352
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2353
+ return de_StartImportJobCommandError(output, context);
2354
+ }
2355
+ const contents = (0, smithy_client_1.map)({
2356
+ $metadata: deserializeMetadata(output),
2357
+ });
2358
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2359
+ const doc = (0, smithy_client_1.take)(data, {
2360
+ importJob: (_) => de_ImportJobData(_, context),
2361
+ });
2362
+ Object.assign(contents, doc);
2363
+ return contents;
2364
+ };
2365
+ exports.de_StartImportJobCommand = de_StartImportJobCommand;
2366
+ const de_StartImportJobCommandError = async (output, context) => {
2367
+ const parsedOutput = {
2368
+ ...output,
2369
+ body: await parseErrorBody(output.body, context),
2370
+ };
2371
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2372
+ switch (errorCode) {
2373
+ case "AccessDeniedException":
2374
+ case "com.amazonaws.qconnect#AccessDeniedException":
2375
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2376
+ case "ConflictException":
2377
+ case "com.amazonaws.qconnect#ConflictException":
2378
+ throw await de_ConflictExceptionRes(parsedOutput, context);
2379
+ case "ResourceNotFoundException":
2380
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2381
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2382
+ case "ServiceQuotaExceededException":
2383
+ case "com.amazonaws.qconnect#ServiceQuotaExceededException":
2384
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
2385
+ case "ValidationException":
2386
+ case "com.amazonaws.qconnect#ValidationException":
2387
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2388
+ default:
2389
+ const parsedBody = parsedOutput.body;
2390
+ return throwDefaultError({
2391
+ output,
2392
+ parsedBody,
2393
+ errorCode,
2394
+ });
2395
+ }
2396
+ };
2397
+ const de_TagResourceCommand = async (output, context) => {
2398
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2399
+ return de_TagResourceCommandError(output, context);
2400
+ }
2401
+ const contents = (0, smithy_client_1.map)({
2402
+ $metadata: deserializeMetadata(output),
2403
+ });
2404
+ await (0, smithy_client_1.collectBody)(output.body, context);
2405
+ return contents;
2406
+ };
2407
+ exports.de_TagResourceCommand = de_TagResourceCommand;
2408
+ const de_TagResourceCommandError = async (output, context) => {
2409
+ const parsedOutput = {
2410
+ ...output,
2411
+ body: await parseErrorBody(output.body, context),
2412
+ };
2413
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2414
+ switch (errorCode) {
2415
+ case "ResourceNotFoundException":
2416
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2417
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2418
+ case "TooManyTagsException":
2419
+ case "com.amazonaws.qconnect#TooManyTagsException":
2420
+ throw await de_TooManyTagsExceptionRes(parsedOutput, context);
2421
+ default:
2422
+ const parsedBody = parsedOutput.body;
2423
+ return throwDefaultError({
2424
+ output,
2425
+ parsedBody,
2426
+ errorCode,
2427
+ });
2428
+ }
2429
+ };
2430
+ const de_UntagResourceCommand = async (output, context) => {
2431
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2432
+ return de_UntagResourceCommandError(output, context);
2433
+ }
2434
+ const contents = (0, smithy_client_1.map)({
2435
+ $metadata: deserializeMetadata(output),
2436
+ });
2437
+ await (0, smithy_client_1.collectBody)(output.body, context);
2438
+ return contents;
2439
+ };
2440
+ exports.de_UntagResourceCommand = de_UntagResourceCommand;
2441
+ const de_UntagResourceCommandError = async (output, context) => {
2442
+ const parsedOutput = {
2443
+ ...output,
2444
+ body: await parseErrorBody(output.body, context),
2445
+ };
2446
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2447
+ switch (errorCode) {
2448
+ case "ResourceNotFoundException":
2449
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2450
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2451
+ default:
2452
+ const parsedBody = parsedOutput.body;
2453
+ return throwDefaultError({
2454
+ output,
2455
+ parsedBody,
2456
+ errorCode,
2457
+ });
2458
+ }
2459
+ };
2460
+ const de_UpdateContentCommand = async (output, context) => {
2461
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2462
+ return de_UpdateContentCommandError(output, context);
2463
+ }
2464
+ const contents = (0, smithy_client_1.map)({
2465
+ $metadata: deserializeMetadata(output),
2466
+ });
2467
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2468
+ const doc = (0, smithy_client_1.take)(data, {
2469
+ content: (_) => de_ContentData(_, context),
2470
+ });
2471
+ Object.assign(contents, doc);
2472
+ return contents;
2473
+ };
2474
+ exports.de_UpdateContentCommand = de_UpdateContentCommand;
2475
+ const de_UpdateContentCommandError = async (output, context) => {
2476
+ const parsedOutput = {
2477
+ ...output,
2478
+ body: await parseErrorBody(output.body, context),
2479
+ };
2480
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2481
+ switch (errorCode) {
2482
+ case "AccessDeniedException":
2483
+ case "com.amazonaws.qconnect#AccessDeniedException":
2484
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2485
+ case "PreconditionFailedException":
2486
+ case "com.amazonaws.qconnect#PreconditionFailedException":
2487
+ throw await de_PreconditionFailedExceptionRes(parsedOutput, context);
2488
+ case "ResourceNotFoundException":
2489
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2490
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2491
+ case "ValidationException":
2492
+ case "com.amazonaws.qconnect#ValidationException":
2493
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2494
+ default:
2495
+ const parsedBody = parsedOutput.body;
2496
+ return throwDefaultError({
2497
+ output,
2498
+ parsedBody,
2499
+ errorCode,
2500
+ });
2501
+ }
2502
+ };
2503
+ const de_UpdateKnowledgeBaseTemplateUriCommand = async (output, context) => {
2504
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2505
+ return de_UpdateKnowledgeBaseTemplateUriCommandError(output, context);
2506
+ }
2507
+ const contents = (0, smithy_client_1.map)({
2508
+ $metadata: deserializeMetadata(output),
2509
+ });
2510
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2511
+ const doc = (0, smithy_client_1.take)(data, {
2512
+ knowledgeBase: (_) => de_KnowledgeBaseData(_, context),
2513
+ });
2514
+ Object.assign(contents, doc);
2515
+ return contents;
2516
+ };
2517
+ exports.de_UpdateKnowledgeBaseTemplateUriCommand = de_UpdateKnowledgeBaseTemplateUriCommand;
2518
+ const de_UpdateKnowledgeBaseTemplateUriCommandError = async (output, context) => {
2519
+ const parsedOutput = {
2520
+ ...output,
2521
+ body: await parseErrorBody(output.body, context),
2522
+ };
2523
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2524
+ switch (errorCode) {
2525
+ case "AccessDeniedException":
2526
+ case "com.amazonaws.qconnect#AccessDeniedException":
2527
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2528
+ case "ResourceNotFoundException":
2529
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2530
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2531
+ case "ValidationException":
2532
+ case "com.amazonaws.qconnect#ValidationException":
2533
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2534
+ default:
2535
+ const parsedBody = parsedOutput.body;
2536
+ return throwDefaultError({
2537
+ output,
2538
+ parsedBody,
2539
+ errorCode,
2540
+ });
2541
+ }
2542
+ };
2543
+ const de_UpdateQuickResponseCommand = async (output, context) => {
2544
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2545
+ return de_UpdateQuickResponseCommandError(output, context);
2546
+ }
2547
+ const contents = (0, smithy_client_1.map)({
2548
+ $metadata: deserializeMetadata(output),
2549
+ });
2550
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2551
+ const doc = (0, smithy_client_1.take)(data, {
2552
+ quickResponse: (_) => de_QuickResponseData(_, context),
2553
+ });
2554
+ Object.assign(contents, doc);
2555
+ return contents;
2556
+ };
2557
+ exports.de_UpdateQuickResponseCommand = de_UpdateQuickResponseCommand;
2558
+ const de_UpdateQuickResponseCommandError = async (output, context) => {
2559
+ const parsedOutput = {
2560
+ ...output,
2561
+ body: await parseErrorBody(output.body, context),
2562
+ };
2563
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2564
+ switch (errorCode) {
2565
+ case "AccessDeniedException":
2566
+ case "com.amazonaws.qconnect#AccessDeniedException":
2567
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
2568
+ case "ConflictException":
2569
+ case "com.amazonaws.qconnect#ConflictException":
2570
+ throw await de_ConflictExceptionRes(parsedOutput, context);
2571
+ case "PreconditionFailedException":
2572
+ case "com.amazonaws.qconnect#PreconditionFailedException":
2573
+ throw await de_PreconditionFailedExceptionRes(parsedOutput, context);
2574
+ case "ResourceNotFoundException":
2575
+ case "com.amazonaws.qconnect#ResourceNotFoundException":
2576
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
2577
+ case "ValidationException":
2578
+ case "com.amazonaws.qconnect#ValidationException":
2579
+ throw await de_ValidationExceptionRes(parsedOutput, context);
2580
+ default:
2581
+ const parsedBody = parsedOutput.body;
2582
+ return throwDefaultError({
2583
+ output,
2584
+ parsedBody,
2585
+ errorCode,
2586
+ });
2587
+ }
2588
+ };
2589
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(QConnectServiceException_1.QConnectServiceException);
2590
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
2591
+ const contents = (0, smithy_client_1.map)({});
2592
+ const data = parsedOutput.body;
2593
+ const doc = (0, smithy_client_1.take)(data, {
2594
+ message: smithy_client_1.expectString,
2595
+ });
2596
+ Object.assign(contents, doc);
2597
+ const exception = new models_0_1.AccessDeniedException({
2598
+ $metadata: deserializeMetadata(parsedOutput),
2599
+ ...contents,
2600
+ });
2601
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2602
+ };
2603
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
2604
+ const contents = (0, smithy_client_1.map)({});
2605
+ const data = parsedOutput.body;
2606
+ const doc = (0, smithy_client_1.take)(data, {
2607
+ message: smithy_client_1.expectString,
2608
+ });
2609
+ Object.assign(contents, doc);
2610
+ const exception = new models_0_1.ConflictException({
2611
+ $metadata: deserializeMetadata(parsedOutput),
2612
+ ...contents,
2613
+ });
2614
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2615
+ };
2616
+ const de_PreconditionFailedExceptionRes = async (parsedOutput, context) => {
2617
+ const contents = (0, smithy_client_1.map)({});
2618
+ const data = parsedOutput.body;
2619
+ const doc = (0, smithy_client_1.take)(data, {
2620
+ message: smithy_client_1.expectString,
2621
+ });
2622
+ Object.assign(contents, doc);
2623
+ const exception = new models_0_1.PreconditionFailedException({
2624
+ $metadata: deserializeMetadata(parsedOutput),
2625
+ ...contents,
2626
+ });
2627
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2628
+ };
2629
+ const de_RequestTimeoutExceptionRes = async (parsedOutput, context) => {
2630
+ const contents = (0, smithy_client_1.map)({});
2631
+ const data = parsedOutput.body;
2632
+ const doc = (0, smithy_client_1.take)(data, {
2633
+ message: smithy_client_1.expectString,
2634
+ });
2635
+ Object.assign(contents, doc);
2636
+ const exception = new models_0_1.RequestTimeoutException({
2637
+ $metadata: deserializeMetadata(parsedOutput),
2638
+ ...contents,
2639
+ });
2640
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2641
+ };
2642
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
2643
+ const contents = (0, smithy_client_1.map)({});
2644
+ const data = parsedOutput.body;
2645
+ const doc = (0, smithy_client_1.take)(data, {
2646
+ message: smithy_client_1.expectString,
2647
+ resourceName: smithy_client_1.expectString,
2648
+ });
2649
+ Object.assign(contents, doc);
2650
+ const exception = new models_0_1.ResourceNotFoundException({
2651
+ $metadata: deserializeMetadata(parsedOutput),
2652
+ ...contents,
2653
+ });
2654
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2655
+ };
2656
+ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
2657
+ const contents = (0, smithy_client_1.map)({});
2658
+ const data = parsedOutput.body;
2659
+ const doc = (0, smithy_client_1.take)(data, {
2660
+ message: smithy_client_1.expectString,
2661
+ });
2662
+ Object.assign(contents, doc);
2663
+ const exception = new models_0_1.ServiceQuotaExceededException({
2664
+ $metadata: deserializeMetadata(parsedOutput),
2665
+ ...contents,
2666
+ });
2667
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2668
+ };
2669
+ const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
2670
+ const contents = (0, smithy_client_1.map)({});
2671
+ const data = parsedOutput.body;
2672
+ const doc = (0, smithy_client_1.take)(data, {
2673
+ message: smithy_client_1.expectString,
2674
+ resourceName: smithy_client_1.expectString,
2675
+ });
2676
+ Object.assign(contents, doc);
2677
+ const exception = new models_0_1.TooManyTagsException({
2678
+ $metadata: deserializeMetadata(parsedOutput),
2679
+ ...contents,
2680
+ });
2681
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2682
+ };
2683
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
2684
+ const contents = (0, smithy_client_1.map)({});
2685
+ const data = parsedOutput.body;
2686
+ const doc = (0, smithy_client_1.take)(data, {
2687
+ message: smithy_client_1.expectString,
2688
+ });
2689
+ Object.assign(contents, doc);
2690
+ const exception = new models_0_1.ValidationException({
2691
+ $metadata: deserializeMetadata(parsedOutput),
2692
+ ...contents,
2693
+ });
2694
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2695
+ };
2696
+ const de_ContentData = (output, context) => {
2697
+ return (0, smithy_client_1.take)(output, {
2698
+ contentArn: smithy_client_1.expectString,
2699
+ contentId: smithy_client_1.expectString,
2700
+ contentType: smithy_client_1.expectString,
2701
+ knowledgeBaseArn: smithy_client_1.expectString,
2702
+ knowledgeBaseId: smithy_client_1.expectString,
2703
+ linkOutUri: smithy_client_1.expectString,
2704
+ metadata: smithy_client_1._json,
2705
+ name: smithy_client_1.expectString,
2706
+ revisionId: smithy_client_1.expectString,
2707
+ status: smithy_client_1.expectString,
2708
+ tags: smithy_client_1._json,
2709
+ title: smithy_client_1.expectString,
2710
+ url: smithy_client_1.expectString,
2711
+ urlExpiry: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2712
+ });
2713
+ };
2714
+ const de_ContentDataDetails = (output, context) => {
2715
+ return (0, smithy_client_1.take)(output, {
2716
+ rankingData: (_) => de_RankingData(_, context),
2717
+ textData: smithy_client_1._json,
2718
+ });
2719
+ };
2720
+ const de_DataDetails = (output, context) => {
2721
+ if (output.contentData != null) {
2722
+ return {
2723
+ contentData: de_ContentDataDetails(output.contentData, context),
2724
+ };
2725
+ }
2726
+ if (output.generativeData != null) {
2727
+ return {
2728
+ generativeData: de_GenerativeDataDetails(output.generativeData, context),
2729
+ };
2730
+ }
2731
+ if (output.sourceContentData != null) {
2732
+ return {
2733
+ sourceContentData: de_SourceContentDataDetails(output.sourceContentData, context),
2734
+ };
2735
+ }
2736
+ return { $unknown: Object.entries(output)[0] };
2737
+ };
2738
+ const de_DataSummary = (output, context) => {
2739
+ return (0, smithy_client_1.take)(output, {
2740
+ details: (_) => de_DataDetails((0, core_1.awsExpectUnion)(_), context),
2741
+ reference: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
2742
+ });
2743
+ };
2744
+ const de_DataSummaryList = (output, context) => {
2745
+ const retVal = (output || [])
2746
+ .filter((e) => e != null)
2747
+ .map((entry) => {
2748
+ return de_DataSummary(entry, context);
2749
+ });
2750
+ return retVal;
2751
+ };
2752
+ const de_GenerativeDataDetails = (output, context) => {
2753
+ return (0, smithy_client_1.take)(output, {
2754
+ completion: smithy_client_1.expectString,
2755
+ rankingData: (_) => de_RankingData(_, context),
2756
+ references: (_) => de_DataSummaryList(_, context),
2757
+ });
2758
+ };
2759
+ const de_ImportJobData = (output, context) => {
2760
+ return (0, smithy_client_1.take)(output, {
2761
+ createdTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2762
+ externalSourceConfiguration: smithy_client_1._json,
2763
+ failedRecordReport: smithy_client_1.expectString,
2764
+ importJobId: smithy_client_1.expectString,
2765
+ importJobType: smithy_client_1.expectString,
2766
+ knowledgeBaseArn: smithy_client_1.expectString,
2767
+ knowledgeBaseId: smithy_client_1.expectString,
2768
+ lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2769
+ metadata: smithy_client_1._json,
2770
+ status: smithy_client_1.expectString,
2771
+ uploadId: smithy_client_1.expectString,
2772
+ url: smithy_client_1.expectString,
2773
+ urlExpiry: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2774
+ });
2775
+ };
2776
+ const de_ImportJobList = (output, context) => {
2777
+ const retVal = (output || [])
2778
+ .filter((e) => e != null)
2779
+ .map((entry) => {
2780
+ return de_ImportJobSummary(entry, context);
2781
+ });
2782
+ return retVal;
2783
+ };
2784
+ const de_ImportJobSummary = (output, context) => {
2785
+ return (0, smithy_client_1.take)(output, {
2786
+ createdTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2787
+ externalSourceConfiguration: smithy_client_1._json,
2788
+ importJobId: smithy_client_1.expectString,
2789
+ importJobType: smithy_client_1.expectString,
2790
+ knowledgeBaseArn: smithy_client_1.expectString,
2791
+ knowledgeBaseId: smithy_client_1.expectString,
2792
+ lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2793
+ metadata: smithy_client_1._json,
2794
+ status: smithy_client_1.expectString,
2795
+ uploadId: smithy_client_1.expectString,
2796
+ });
2797
+ };
2798
+ const de_KnowledgeBaseData = (output, context) => {
2799
+ return (0, smithy_client_1.take)(output, {
2800
+ description: smithy_client_1.expectString,
2801
+ knowledgeBaseArn: smithy_client_1.expectString,
2802
+ knowledgeBaseId: smithy_client_1.expectString,
2803
+ knowledgeBaseType: smithy_client_1.expectString,
2804
+ lastContentModificationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2805
+ name: smithy_client_1.expectString,
2806
+ renderingConfiguration: smithy_client_1._json,
2807
+ serverSideEncryptionConfiguration: smithy_client_1._json,
2808
+ sourceConfiguration: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
2809
+ status: smithy_client_1.expectString,
2810
+ tags: smithy_client_1._json,
2811
+ });
2812
+ };
2813
+ const de_QueryResultsList = (output, context) => {
2814
+ const retVal = (output || [])
2815
+ .filter((e) => e != null)
2816
+ .map((entry) => {
2817
+ return de_ResultData(entry, context);
2818
+ });
2819
+ return retVal;
2820
+ };
2821
+ const de_QuickResponseData = (output, context) => {
2822
+ return (0, smithy_client_1.take)(output, {
2823
+ channels: smithy_client_1._json,
2824
+ contentType: smithy_client_1.expectString,
2825
+ contents: smithy_client_1._json,
2826
+ createdTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2827
+ description: smithy_client_1.expectString,
2828
+ groupingConfiguration: smithy_client_1._json,
2829
+ isActive: smithy_client_1.expectBoolean,
2830
+ knowledgeBaseArn: smithy_client_1.expectString,
2831
+ knowledgeBaseId: smithy_client_1.expectString,
2832
+ language: smithy_client_1.expectString,
2833
+ lastModifiedBy: smithy_client_1.expectString,
2834
+ lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2835
+ name: smithy_client_1.expectString,
2836
+ quickResponseArn: smithy_client_1.expectString,
2837
+ quickResponseId: smithy_client_1.expectString,
2838
+ shortcutKey: smithy_client_1.expectString,
2839
+ status: smithy_client_1.expectString,
2840
+ tags: smithy_client_1._json,
2841
+ });
2842
+ };
2843
+ const de_QuickResponseSearchResultData = (output, context) => {
2844
+ return (0, smithy_client_1.take)(output, {
2845
+ attributesInterpolated: smithy_client_1._json,
2846
+ attributesNotInterpolated: smithy_client_1._json,
2847
+ channels: smithy_client_1._json,
2848
+ contentType: smithy_client_1.expectString,
2849
+ contents: smithy_client_1._json,
2850
+ createdTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2851
+ description: smithy_client_1.expectString,
2852
+ groupingConfiguration: smithy_client_1._json,
2853
+ isActive: smithy_client_1.expectBoolean,
2854
+ knowledgeBaseArn: smithy_client_1.expectString,
2855
+ knowledgeBaseId: smithy_client_1.expectString,
2856
+ language: smithy_client_1.expectString,
2857
+ lastModifiedBy: smithy_client_1.expectString,
2858
+ lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2859
+ name: smithy_client_1.expectString,
2860
+ quickResponseArn: smithy_client_1.expectString,
2861
+ quickResponseId: smithy_client_1.expectString,
2862
+ shortcutKey: smithy_client_1.expectString,
2863
+ status: smithy_client_1.expectString,
2864
+ tags: smithy_client_1._json,
2865
+ });
2866
+ };
2867
+ const de_QuickResponseSearchResultsList = (output, context) => {
2868
+ const retVal = (output || [])
2869
+ .filter((e) => e != null)
2870
+ .map((entry) => {
2871
+ return de_QuickResponseSearchResultData(entry, context);
2872
+ });
2873
+ return retVal;
2874
+ };
2875
+ const de_QuickResponseSummary = (output, context) => {
2876
+ return (0, smithy_client_1.take)(output, {
2877
+ channels: smithy_client_1._json,
2878
+ contentType: smithy_client_1.expectString,
2879
+ createdTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2880
+ description: smithy_client_1.expectString,
2881
+ isActive: smithy_client_1.expectBoolean,
2882
+ knowledgeBaseArn: smithy_client_1.expectString,
2883
+ knowledgeBaseId: smithy_client_1.expectString,
2884
+ lastModifiedBy: smithy_client_1.expectString,
2885
+ lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
2886
+ name: smithy_client_1.expectString,
2887
+ quickResponseArn: smithy_client_1.expectString,
2888
+ quickResponseId: smithy_client_1.expectString,
2889
+ status: smithy_client_1.expectString,
2890
+ tags: smithy_client_1._json,
2891
+ });
2892
+ };
2893
+ const de_QuickResponseSummaryList = (output, context) => {
2894
+ const retVal = (output || [])
2895
+ .filter((e) => e != null)
2896
+ .map((entry) => {
2897
+ return de_QuickResponseSummary(entry, context);
2898
+ });
2899
+ return retVal;
2900
+ };
2901
+ const de_RankingData = (output, context) => {
2902
+ return (0, smithy_client_1.take)(output, {
2903
+ relevanceLevel: smithy_client_1.expectString,
2904
+ relevanceScore: smithy_client_1.limitedParseDouble,
2905
+ });
2906
+ };
2907
+ const de_RecommendationData = (output, context) => {
2908
+ return (0, smithy_client_1.take)(output, {
2909
+ data: (_) => de_DataSummary(_, context),
2910
+ document: smithy_client_1._json,
2911
+ recommendationId: smithy_client_1.expectString,
2912
+ relevanceLevel: smithy_client_1.expectString,
2913
+ relevanceScore: smithy_client_1.limitedParseDouble,
2914
+ type: smithy_client_1.expectString,
2915
+ });
2916
+ };
2917
+ const de_RecommendationList = (output, context) => {
2918
+ const retVal = (output || [])
2919
+ .filter((e) => e != null)
2920
+ .map((entry) => {
2921
+ return de_RecommendationData(entry, context);
2922
+ });
2923
+ return retVal;
2924
+ };
2925
+ const de_ResultData = (output, context) => {
2926
+ return (0, smithy_client_1.take)(output, {
2927
+ data: (_) => de_DataSummary(_, context),
2928
+ document: smithy_client_1._json,
2929
+ relevanceScore: smithy_client_1.limitedParseDouble,
2930
+ resultId: smithy_client_1.expectString,
2931
+ type: smithy_client_1.expectString,
2932
+ });
2933
+ };
2934
+ const de_SourceContentDataDetails = (output, context) => {
2935
+ return (0, smithy_client_1.take)(output, {
2936
+ id: smithy_client_1.expectString,
2937
+ rankingData: (_) => de_RankingData(_, context),
2938
+ textData: smithy_client_1._json,
2939
+ type: smithy_client_1.expectString,
2940
+ });
2941
+ };
2942
+ const deserializeMetadata = (output) => ({
2943
+ httpStatusCode: output.statusCode,
2944
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
2945
+ extendedRequestId: output.headers["x-amz-id-2"],
2946
+ cfId: output.headers["x-amz-cf-id"],
2947
+ });
2948
+ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
2949
+ const isSerializableHeaderValue = (value) => value !== undefined &&
2950
+ value !== null &&
2951
+ value !== "" &&
2952
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2953
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2954
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2955
+ if (encoded.length) {
2956
+ return JSON.parse(encoded);
2957
+ }
2958
+ return {};
2959
+ });
2960
+ const parseErrorBody = async (errorBody, context) => {
2961
+ const value = await parseBody(errorBody, context);
2962
+ value.message = value.message ?? value.Message;
2963
+ return value;
2964
+ };
2965
+ const loadRestJsonErrorCode = (output, data) => {
2966
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2967
+ const sanitizeErrorCode = (rawValue) => {
2968
+ let cleanValue = rawValue;
2969
+ if (typeof cleanValue === "number") {
2970
+ cleanValue = cleanValue.toString();
2971
+ }
2972
+ if (cleanValue.indexOf(",") >= 0) {
2973
+ cleanValue = cleanValue.split(",")[0];
2974
+ }
2975
+ if (cleanValue.indexOf(":") >= 0) {
2976
+ cleanValue = cleanValue.split(":")[0];
2977
+ }
2978
+ if (cleanValue.indexOf("#") >= 0) {
2979
+ cleanValue = cleanValue.split("#")[1];
2980
+ }
2981
+ return cleanValue;
2982
+ };
2983
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2984
+ if (headerKey !== undefined) {
2985
+ return sanitizeErrorCode(output.headers[headerKey]);
2986
+ }
2987
+ if (data.code !== undefined) {
2988
+ return sanitizeErrorCode(data.code);
2989
+ }
2990
+ if (data["__type"] !== undefined) {
2991
+ return sanitizeErrorCode(data["__type"]);
2992
+ }
2993
+ };