@aws-sdk/client-mturk 3.35.0 → 3.38.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 (367) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist-cjs/MTurk.js +0 -4
  3. package/dist-cjs/MTurkClient.js +0 -9
  4. package/dist-cjs/commands/AcceptQualificationRequestCommand.js +0 -34
  5. package/dist-cjs/commands/ApproveAssignmentCommand.js +0 -54
  6. package/dist-cjs/commands/AssociateQualificationWithWorkerCommand.js +0 -45
  7. package/dist-cjs/commands/CreateAdditionalAssignmentsForHITCommand.js +0 -47
  8. package/dist-cjs/commands/CreateHITCommand.js +0 -41
  9. package/dist-cjs/commands/CreateHITTypeCommand.js +0 -30
  10. package/dist-cjs/commands/CreateHITWithHITTypeCommand.js +0 -42
  11. package/dist-cjs/commands/CreateQualificationTypeCommand.js +0 -31
  12. package/dist-cjs/commands/CreateWorkerBlockCommand.js +0 -25
  13. package/dist-cjs/commands/DeleteHITCommand.js +0 -60
  14. package/dist-cjs/commands/DeleteQualificationTypeCommand.js +0 -43
  15. package/dist-cjs/commands/DeleteWorkerBlockCommand.js +0 -25
  16. package/dist-cjs/commands/DisassociateQualificationFromWorkerCommand.js +0 -32
  17. package/dist-cjs/commands/GetAccountBalanceCommand.js +0 -27
  18. package/dist-cjs/commands/GetAssignmentCommand.js +0 -27
  19. package/dist-cjs/commands/GetFileUploadURLCommand.js +0 -42
  20. package/dist-cjs/commands/GetHITCommand.js +0 -27
  21. package/dist-cjs/commands/GetQualificationScoreCommand.js +0 -38
  22. package/dist-cjs/commands/GetQualificationTypeCommand.js +0 -27
  23. package/dist-cjs/commands/ListAssignmentsForHITCommand.js +0 -51
  24. package/dist-cjs/commands/ListBonusPaymentsCommand.js +0 -30
  25. package/dist-cjs/commands/ListHITsCommand.js +0 -31
  26. package/dist-cjs/commands/ListHITsForQualificationTypeCommand.js +0 -30
  27. package/dist-cjs/commands/ListQualificationRequestsCommand.js +0 -32
  28. package/dist-cjs/commands/ListQualificationTypesCommand.js +0 -30
  29. package/dist-cjs/commands/ListReviewPolicyResultsForHITCommand.js +0 -31
  30. package/dist-cjs/commands/ListReviewableHITsCommand.js +0 -28
  31. package/dist-cjs/commands/ListWorkerBlocksCommand.js +0 -25
  32. package/dist-cjs/commands/ListWorkersWithQualificationTypeCommand.js +0 -28
  33. package/dist-cjs/commands/NotifyWorkersCommand.js +0 -34
  34. package/dist-cjs/commands/RejectAssignmentCommand.js +0 -37
  35. package/dist-cjs/commands/RejectQualificationRequestCommand.js +0 -31
  36. package/dist-cjs/commands/SendBonusCommand.js +0 -38
  37. package/dist-cjs/commands/SendTestEventNotificationCommand.js +0 -31
  38. package/dist-cjs/commands/UpdateExpirationForHITCommand.js +0 -28
  39. package/dist-cjs/commands/UpdateHITReviewStatusCommand.js +0 -29
  40. package/dist-cjs/commands/UpdateHITTypeOfHITCommand.js +0 -32
  41. package/dist-cjs/commands/UpdateNotificationSettingsCommand.js +0 -36
  42. package/dist-cjs/commands/UpdateQualificationTypeCommand.js +0 -57
  43. package/dist-cjs/commands/index.js +42 -0
  44. package/dist-cjs/endpoints.js +1 -2
  45. package/dist-cjs/index.js +4 -53
  46. package/dist-cjs/models/index.js +0 -1
  47. package/dist-cjs/models/models_0.js +0 -295
  48. package/dist-cjs/pagination/Interfaces.js +0 -1
  49. package/dist-cjs/pagination/ListAssignmentsForHITPaginator.js +0 -11
  50. package/dist-cjs/pagination/ListBonusPaymentsPaginator.js +0 -11
  51. package/dist-cjs/pagination/ListHITsForQualificationTypePaginator.js +0 -11
  52. package/dist-cjs/pagination/ListHITsPaginator.js +0 -11
  53. package/dist-cjs/pagination/ListQualificationRequestsPaginator.js +0 -11
  54. package/dist-cjs/pagination/ListQualificationTypesPaginator.js +0 -11
  55. package/dist-cjs/pagination/ListReviewPolicyResultsForHITPaginator.js +0 -11
  56. package/dist-cjs/pagination/ListReviewableHITsPaginator.js +0 -11
  57. package/dist-cjs/pagination/ListWorkerBlocksPaginator.js +0 -11
  58. package/dist-cjs/pagination/ListWorkersWithQualificationTypePaginator.js +0 -11
  59. package/dist-cjs/pagination/index.js +14 -0
  60. package/dist-cjs/protocols/Aws_json1_1.js +0 -6
  61. package/dist-cjs/runtimeConfig.browser.js +1 -6
  62. package/dist-cjs/runtimeConfig.js +2 -7
  63. package/dist-cjs/runtimeConfig.native.js +0 -4
  64. package/dist-cjs/runtimeConfig.shared.js +0 -4
  65. package/dist-es/MTurk.js +0 -1
  66. package/dist-es/MTurkClient.js +0 -1
  67. package/dist-es/commands/AcceptQualificationRequestCommand.js +0 -1
  68. package/dist-es/commands/ApproveAssignmentCommand.js +0 -1
  69. package/dist-es/commands/AssociateQualificationWithWorkerCommand.js +0 -1
  70. package/dist-es/commands/CreateAdditionalAssignmentsForHITCommand.js +0 -1
  71. package/dist-es/commands/CreateHITCommand.js +0 -1
  72. package/dist-es/commands/CreateHITTypeCommand.js +0 -1
  73. package/dist-es/commands/CreateHITWithHITTypeCommand.js +0 -1
  74. package/dist-es/commands/CreateQualificationTypeCommand.js +0 -1
  75. package/dist-es/commands/CreateWorkerBlockCommand.js +0 -1
  76. package/dist-es/commands/DeleteHITCommand.js +0 -1
  77. package/dist-es/commands/DeleteQualificationTypeCommand.js +0 -1
  78. package/dist-es/commands/DeleteWorkerBlockCommand.js +0 -1
  79. package/dist-es/commands/DisassociateQualificationFromWorkerCommand.js +0 -1
  80. package/dist-es/commands/GetAccountBalanceCommand.js +0 -1
  81. package/dist-es/commands/GetAssignmentCommand.js +0 -1
  82. package/dist-es/commands/GetFileUploadURLCommand.js +0 -1
  83. package/dist-es/commands/GetHITCommand.js +0 -1
  84. package/dist-es/commands/GetQualificationScoreCommand.js +0 -1
  85. package/dist-es/commands/GetQualificationTypeCommand.js +0 -1
  86. package/dist-es/commands/ListAssignmentsForHITCommand.js +0 -1
  87. package/dist-es/commands/ListBonusPaymentsCommand.js +0 -1
  88. package/dist-es/commands/ListHITsCommand.js +0 -1
  89. package/dist-es/commands/ListHITsForQualificationTypeCommand.js +0 -1
  90. package/dist-es/commands/ListQualificationRequestsCommand.js +0 -1
  91. package/dist-es/commands/ListQualificationTypesCommand.js +0 -1
  92. package/dist-es/commands/ListReviewPolicyResultsForHITCommand.js +0 -1
  93. package/dist-es/commands/ListReviewableHITsCommand.js +0 -1
  94. package/dist-es/commands/ListWorkerBlocksCommand.js +0 -1
  95. package/dist-es/commands/ListWorkersWithQualificationTypeCommand.js +0 -1
  96. package/dist-es/commands/NotifyWorkersCommand.js +0 -1
  97. package/dist-es/commands/RejectAssignmentCommand.js +0 -1
  98. package/dist-es/commands/RejectQualificationRequestCommand.js +0 -1
  99. package/dist-es/commands/SendBonusCommand.js +0 -1
  100. package/dist-es/commands/SendTestEventNotificationCommand.js +0 -1
  101. package/dist-es/commands/UpdateExpirationForHITCommand.js +0 -1
  102. package/dist-es/commands/UpdateHITReviewStatusCommand.js +0 -1
  103. package/dist-es/commands/UpdateHITTypeOfHITCommand.js +0 -1
  104. package/dist-es/commands/UpdateNotificationSettingsCommand.js +0 -1
  105. package/dist-es/commands/UpdateQualificationTypeCommand.js +0 -1
  106. package/dist-es/commands/index.js +39 -0
  107. package/dist-es/endpoints.js +1 -2
  108. package/dist-es/index.js +4 -53
  109. package/dist-es/models/index.js +0 -1
  110. package/dist-es/models/models_0.js +0 -1
  111. package/dist-es/pagination/Interfaces.js +0 -1
  112. package/dist-es/pagination/ListAssignmentsForHITPaginator.js +0 -1
  113. package/dist-es/pagination/ListBonusPaymentsPaginator.js +0 -1
  114. package/dist-es/pagination/ListHITsForQualificationTypePaginator.js +0 -1
  115. package/dist-es/pagination/ListHITsPaginator.js +0 -1
  116. package/dist-es/pagination/ListQualificationRequestsPaginator.js +0 -1
  117. package/dist-es/pagination/ListQualificationTypesPaginator.js +0 -1
  118. package/dist-es/pagination/ListReviewPolicyResultsForHITPaginator.js +0 -1
  119. package/dist-es/pagination/ListReviewableHITsPaginator.js +0 -1
  120. package/dist-es/pagination/ListWorkerBlocksPaginator.js +0 -1
  121. package/dist-es/pagination/ListWorkersWithQualificationTypePaginator.js +0 -1
  122. package/dist-es/pagination/index.js +11 -0
  123. package/dist-es/protocols/Aws_json1_1.js +0 -1
  124. package/dist-es/runtimeConfig.browser.js +1 -2
  125. package/dist-es/runtimeConfig.js +2 -3
  126. package/dist-es/runtimeConfig.native.js +0 -1
  127. package/dist-es/runtimeConfig.shared.js +0 -1
  128. package/dist-types/commands/index.d.ts +39 -0
  129. package/dist-types/index.d.ts +4 -52
  130. package/dist-types/pagination/index.d.ts +11 -0
  131. package/dist-types/ts3.4/MTurk.d.ts +40 -511
  132. package/dist-types/ts3.4/MTurkClient.d.ts +24 -89
  133. package/dist-types/ts3.4/commands/AcceptQualificationRequestCommand.d.ts +2 -29
  134. package/dist-types/ts3.4/commands/ApproveAssignmentCommand.d.ts +2 -49
  135. package/dist-types/ts3.4/commands/AssociateQualificationWithWorkerCommand.d.ts +2 -40
  136. package/dist-types/ts3.4/commands/CreateAdditionalAssignmentsForHITCommand.d.ts +2 -42
  137. package/dist-types/ts3.4/commands/CreateHITCommand.d.ts +2 -36
  138. package/dist-types/ts3.4/commands/CreateHITTypeCommand.d.ts +2 -25
  139. package/dist-types/ts3.4/commands/CreateHITWithHITTypeCommand.d.ts +2 -37
  140. package/dist-types/ts3.4/commands/CreateQualificationTypeCommand.d.ts +2 -26
  141. package/dist-types/ts3.4/commands/CreateWorkerBlockCommand.d.ts +2 -20
  142. package/dist-types/ts3.4/commands/DeleteHITCommand.d.ts +2 -55
  143. package/dist-types/ts3.4/commands/DeleteQualificationTypeCommand.d.ts +2 -38
  144. package/dist-types/ts3.4/commands/DeleteWorkerBlockCommand.d.ts +2 -20
  145. package/dist-types/ts3.4/commands/DisassociateQualificationFromWorkerCommand.d.ts +2 -27
  146. package/dist-types/ts3.4/commands/GetAccountBalanceCommand.d.ts +2 -22
  147. package/dist-types/ts3.4/commands/GetAssignmentCommand.d.ts +2 -22
  148. package/dist-types/ts3.4/commands/GetFileUploadURLCommand.d.ts +2 -37
  149. package/dist-types/ts3.4/commands/GetHITCommand.d.ts +2 -22
  150. package/dist-types/ts3.4/commands/GetQualificationScoreCommand.d.ts +2 -33
  151. package/dist-types/ts3.4/commands/GetQualificationTypeCommand.d.ts +2 -22
  152. package/dist-types/ts3.4/commands/ListAssignmentsForHITCommand.d.ts +2 -46
  153. package/dist-types/ts3.4/commands/ListBonusPaymentsCommand.d.ts +2 -25
  154. package/dist-types/ts3.4/commands/ListHITsCommand.d.ts +2 -26
  155. package/dist-types/ts3.4/commands/ListHITsForQualificationTypeCommand.d.ts +2 -25
  156. package/dist-types/ts3.4/commands/ListQualificationRequestsCommand.d.ts +2 -27
  157. package/dist-types/ts3.4/commands/ListQualificationTypesCommand.d.ts +2 -25
  158. package/dist-types/ts3.4/commands/ListReviewPolicyResultsForHITCommand.d.ts +2 -26
  159. package/dist-types/ts3.4/commands/ListReviewableHITsCommand.d.ts +2 -23
  160. package/dist-types/ts3.4/commands/ListWorkerBlocksCommand.d.ts +2 -20
  161. package/dist-types/ts3.4/commands/ListWorkersWithQualificationTypeCommand.d.ts +2 -23
  162. package/dist-types/ts3.4/commands/NotifyWorkersCommand.d.ts +2 -29
  163. package/dist-types/ts3.4/commands/RejectAssignmentCommand.d.ts +2 -32
  164. package/dist-types/ts3.4/commands/RejectQualificationRequestCommand.d.ts +2 -26
  165. package/dist-types/ts3.4/commands/SendBonusCommand.d.ts +2 -33
  166. package/dist-types/ts3.4/commands/SendTestEventNotificationCommand.d.ts +2 -26
  167. package/dist-types/ts3.4/commands/UpdateExpirationForHITCommand.d.ts +2 -23
  168. package/dist-types/ts3.4/commands/UpdateHITReviewStatusCommand.d.ts +2 -24
  169. package/dist-types/ts3.4/commands/UpdateHITTypeOfHITCommand.d.ts +2 -27
  170. package/dist-types/ts3.4/commands/UpdateNotificationSettingsCommand.d.ts +2 -31
  171. package/dist-types/ts3.4/commands/UpdateQualificationTypeCommand.d.ts +2 -52
  172. package/dist-types/ts3.4/commands/index.d.ts +39 -0
  173. package/dist-types/ts3.4/index.d.ts +4 -52
  174. package/dist-types/ts3.4/models/models_0.d.ts +406 -1941
  175. package/dist-types/ts3.4/pagination/index.d.ts +11 -0
  176. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  177. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  178. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  179. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  180. package/package.json +33 -30
  181. package/dist-cjs/MTurk.js.map +0 -1
  182. package/dist-cjs/MTurkClient.js.map +0 -1
  183. package/dist-cjs/commands/AcceptQualificationRequestCommand.js.map +0 -1
  184. package/dist-cjs/commands/ApproveAssignmentCommand.js.map +0 -1
  185. package/dist-cjs/commands/AssociateQualificationWithWorkerCommand.js.map +0 -1
  186. package/dist-cjs/commands/CreateAdditionalAssignmentsForHITCommand.js.map +0 -1
  187. package/dist-cjs/commands/CreateHITCommand.js.map +0 -1
  188. package/dist-cjs/commands/CreateHITTypeCommand.js.map +0 -1
  189. package/dist-cjs/commands/CreateHITWithHITTypeCommand.js.map +0 -1
  190. package/dist-cjs/commands/CreateQualificationTypeCommand.js.map +0 -1
  191. package/dist-cjs/commands/CreateWorkerBlockCommand.js.map +0 -1
  192. package/dist-cjs/commands/DeleteHITCommand.js.map +0 -1
  193. package/dist-cjs/commands/DeleteQualificationTypeCommand.js.map +0 -1
  194. package/dist-cjs/commands/DeleteWorkerBlockCommand.js.map +0 -1
  195. package/dist-cjs/commands/DisassociateQualificationFromWorkerCommand.js.map +0 -1
  196. package/dist-cjs/commands/GetAccountBalanceCommand.js.map +0 -1
  197. package/dist-cjs/commands/GetAssignmentCommand.js.map +0 -1
  198. package/dist-cjs/commands/GetFileUploadURLCommand.js.map +0 -1
  199. package/dist-cjs/commands/GetHITCommand.js.map +0 -1
  200. package/dist-cjs/commands/GetQualificationScoreCommand.js.map +0 -1
  201. package/dist-cjs/commands/GetQualificationTypeCommand.js.map +0 -1
  202. package/dist-cjs/commands/ListAssignmentsForHITCommand.js.map +0 -1
  203. package/dist-cjs/commands/ListBonusPaymentsCommand.js.map +0 -1
  204. package/dist-cjs/commands/ListHITsCommand.js.map +0 -1
  205. package/dist-cjs/commands/ListHITsForQualificationTypeCommand.js.map +0 -1
  206. package/dist-cjs/commands/ListQualificationRequestsCommand.js.map +0 -1
  207. package/dist-cjs/commands/ListQualificationTypesCommand.js.map +0 -1
  208. package/dist-cjs/commands/ListReviewPolicyResultsForHITCommand.js.map +0 -1
  209. package/dist-cjs/commands/ListReviewableHITsCommand.js.map +0 -1
  210. package/dist-cjs/commands/ListWorkerBlocksCommand.js.map +0 -1
  211. package/dist-cjs/commands/ListWorkersWithQualificationTypeCommand.js.map +0 -1
  212. package/dist-cjs/commands/NotifyWorkersCommand.js.map +0 -1
  213. package/dist-cjs/commands/RejectAssignmentCommand.js.map +0 -1
  214. package/dist-cjs/commands/RejectQualificationRequestCommand.js.map +0 -1
  215. package/dist-cjs/commands/SendBonusCommand.js.map +0 -1
  216. package/dist-cjs/commands/SendTestEventNotificationCommand.js.map +0 -1
  217. package/dist-cjs/commands/UpdateExpirationForHITCommand.js.map +0 -1
  218. package/dist-cjs/commands/UpdateHITReviewStatusCommand.js.map +0 -1
  219. package/dist-cjs/commands/UpdateHITTypeOfHITCommand.js.map +0 -1
  220. package/dist-cjs/commands/UpdateNotificationSettingsCommand.js.map +0 -1
  221. package/dist-cjs/commands/UpdateQualificationTypeCommand.js.map +0 -1
  222. package/dist-cjs/endpoints.js.map +0 -1
  223. package/dist-cjs/index.js.map +0 -1
  224. package/dist-cjs/models/index.js.map +0 -1
  225. package/dist-cjs/models/models_0.js.map +0 -1
  226. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  227. package/dist-cjs/pagination/ListAssignmentsForHITPaginator.js.map +0 -1
  228. package/dist-cjs/pagination/ListBonusPaymentsPaginator.js.map +0 -1
  229. package/dist-cjs/pagination/ListHITsForQualificationTypePaginator.js.map +0 -1
  230. package/dist-cjs/pagination/ListHITsPaginator.js.map +0 -1
  231. package/dist-cjs/pagination/ListQualificationRequestsPaginator.js.map +0 -1
  232. package/dist-cjs/pagination/ListQualificationTypesPaginator.js.map +0 -1
  233. package/dist-cjs/pagination/ListReviewPolicyResultsForHITPaginator.js.map +0 -1
  234. package/dist-cjs/pagination/ListReviewableHITsPaginator.js.map +0 -1
  235. package/dist-cjs/pagination/ListWorkerBlocksPaginator.js.map +0 -1
  236. package/dist-cjs/pagination/ListWorkersWithQualificationTypePaginator.js.map +0 -1
  237. package/dist-cjs/protocols/Aws_json1_1.js.map +0 -1
  238. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  239. package/dist-cjs/runtimeConfig.js.map +0 -1
  240. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  241. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  242. package/dist-es/MTurk.js.map +0 -1
  243. package/dist-es/MTurkClient.js.map +0 -1
  244. package/dist-es/commands/AcceptQualificationRequestCommand.js.map +0 -1
  245. package/dist-es/commands/ApproveAssignmentCommand.js.map +0 -1
  246. package/dist-es/commands/AssociateQualificationWithWorkerCommand.js.map +0 -1
  247. package/dist-es/commands/CreateAdditionalAssignmentsForHITCommand.js.map +0 -1
  248. package/dist-es/commands/CreateHITCommand.js.map +0 -1
  249. package/dist-es/commands/CreateHITTypeCommand.js.map +0 -1
  250. package/dist-es/commands/CreateHITWithHITTypeCommand.js.map +0 -1
  251. package/dist-es/commands/CreateQualificationTypeCommand.js.map +0 -1
  252. package/dist-es/commands/CreateWorkerBlockCommand.js.map +0 -1
  253. package/dist-es/commands/DeleteHITCommand.js.map +0 -1
  254. package/dist-es/commands/DeleteQualificationTypeCommand.js.map +0 -1
  255. package/dist-es/commands/DeleteWorkerBlockCommand.js.map +0 -1
  256. package/dist-es/commands/DisassociateQualificationFromWorkerCommand.js.map +0 -1
  257. package/dist-es/commands/GetAccountBalanceCommand.js.map +0 -1
  258. package/dist-es/commands/GetAssignmentCommand.js.map +0 -1
  259. package/dist-es/commands/GetFileUploadURLCommand.js.map +0 -1
  260. package/dist-es/commands/GetHITCommand.js.map +0 -1
  261. package/dist-es/commands/GetQualificationScoreCommand.js.map +0 -1
  262. package/dist-es/commands/GetQualificationTypeCommand.js.map +0 -1
  263. package/dist-es/commands/ListAssignmentsForHITCommand.js.map +0 -1
  264. package/dist-es/commands/ListBonusPaymentsCommand.js.map +0 -1
  265. package/dist-es/commands/ListHITsCommand.js.map +0 -1
  266. package/dist-es/commands/ListHITsForQualificationTypeCommand.js.map +0 -1
  267. package/dist-es/commands/ListQualificationRequestsCommand.js.map +0 -1
  268. package/dist-es/commands/ListQualificationTypesCommand.js.map +0 -1
  269. package/dist-es/commands/ListReviewPolicyResultsForHITCommand.js.map +0 -1
  270. package/dist-es/commands/ListReviewableHITsCommand.js.map +0 -1
  271. package/dist-es/commands/ListWorkerBlocksCommand.js.map +0 -1
  272. package/dist-es/commands/ListWorkersWithQualificationTypeCommand.js.map +0 -1
  273. package/dist-es/commands/NotifyWorkersCommand.js.map +0 -1
  274. package/dist-es/commands/RejectAssignmentCommand.js.map +0 -1
  275. package/dist-es/commands/RejectQualificationRequestCommand.js.map +0 -1
  276. package/dist-es/commands/SendBonusCommand.js.map +0 -1
  277. package/dist-es/commands/SendTestEventNotificationCommand.js.map +0 -1
  278. package/dist-es/commands/UpdateExpirationForHITCommand.js.map +0 -1
  279. package/dist-es/commands/UpdateHITReviewStatusCommand.js.map +0 -1
  280. package/dist-es/commands/UpdateHITTypeOfHITCommand.js.map +0 -1
  281. package/dist-es/commands/UpdateNotificationSettingsCommand.js.map +0 -1
  282. package/dist-es/commands/UpdateQualificationTypeCommand.js.map +0 -1
  283. package/dist-es/endpoints.js.map +0 -1
  284. package/dist-es/index.js.map +0 -1
  285. package/dist-es/models/index.js.map +0 -1
  286. package/dist-es/models/models_0.js.map +0 -1
  287. package/dist-es/pagination/Interfaces.js.map +0 -1
  288. package/dist-es/pagination/ListAssignmentsForHITPaginator.js.map +0 -1
  289. package/dist-es/pagination/ListBonusPaymentsPaginator.js.map +0 -1
  290. package/dist-es/pagination/ListHITsForQualificationTypePaginator.js.map +0 -1
  291. package/dist-es/pagination/ListHITsPaginator.js.map +0 -1
  292. package/dist-es/pagination/ListQualificationRequestsPaginator.js.map +0 -1
  293. package/dist-es/pagination/ListQualificationTypesPaginator.js.map +0 -1
  294. package/dist-es/pagination/ListReviewPolicyResultsForHITPaginator.js.map +0 -1
  295. package/dist-es/pagination/ListReviewableHITsPaginator.js.map +0 -1
  296. package/dist-es/pagination/ListWorkerBlocksPaginator.js.map +0 -1
  297. package/dist-es/pagination/ListWorkersWithQualificationTypePaginator.js.map +0 -1
  298. package/dist-es/protocols/Aws_json1_1.js.map +0 -1
  299. package/dist-es/runtimeConfig.browser.js.map +0 -1
  300. package/dist-es/runtimeConfig.js.map +0 -1
  301. package/dist-es/runtimeConfig.native.js.map +0 -1
  302. package/dist-es/runtimeConfig.shared.js.map +0 -1
  303. package/jest.config.js +0 -4
  304. package/src/MTurk.ts +0 -1792
  305. package/src/MTurkClient.ts +0 -416
  306. package/src/commands/AcceptQualificationRequestCommand.ts +0 -107
  307. package/src/commands/ApproveAssignmentCommand.ts +0 -124
  308. package/src/commands/AssociateQualificationWithWorkerCommand.ts +0 -123
  309. package/src/commands/CreateAdditionalAssignmentsForHITCommand.ts +0 -128
  310. package/src/commands/CreateHITCommand.ts +0 -108
  311. package/src/commands/CreateHITTypeCommand.ts +0 -100
  312. package/src/commands/CreateHITWithHITTypeCommand.ts +0 -112
  313. package/src/commands/CreateQualificationTypeCommand.ts +0 -101
  314. package/src/commands/CreateWorkerBlockCommand.ts +0 -95
  315. package/src/commands/DeleteHITCommand.ts +0 -127
  316. package/src/commands/DeleteQualificationTypeCommand.ts +0 -113
  317. package/src/commands/DeleteWorkerBlockCommand.ts +0 -95
  318. package/src/commands/DisassociateQualificationFromWorkerCommand.ts +0 -113
  319. package/src/commands/GetAccountBalanceCommand.ts +0 -97
  320. package/src/commands/GetAssignmentCommand.ts +0 -97
  321. package/src/commands/GetFileUploadURLCommand.ts +0 -112
  322. package/src/commands/GetHITCommand.ts +0 -90
  323. package/src/commands/GetQualificationScoreCommand.ts +0 -108
  324. package/src/commands/GetQualificationTypeCommand.ts +0 -97
  325. package/src/commands/ListAssignmentsForHITCommand.ts +0 -121
  326. package/src/commands/ListBonusPaymentsCommand.ts +0 -100
  327. package/src/commands/ListHITsCommand.ts +0 -94
  328. package/src/commands/ListHITsForQualificationTypeCommand.ts +0 -105
  329. package/src/commands/ListQualificationRequestsCommand.ts +0 -105
  330. package/src/commands/ListQualificationTypesCommand.ts +0 -100
  331. package/src/commands/ListReviewPolicyResultsForHITCommand.ts +0 -106
  332. package/src/commands/ListReviewableHITsCommand.ts +0 -98
  333. package/src/commands/ListWorkerBlocksCommand.ts +0 -95
  334. package/src/commands/ListWorkersWithQualificationTypeCommand.ts +0 -106
  335. package/src/commands/NotifyWorkersCommand.ts +0 -104
  336. package/src/commands/RejectAssignmentCommand.ts +0 -107
  337. package/src/commands/RejectQualificationRequestCommand.ts +0 -104
  338. package/src/commands/SendBonusCommand.ts +0 -105
  339. package/src/commands/SendTestEventNotificationCommand.ts +0 -104
  340. package/src/commands/UpdateExpirationForHITCommand.ts +0 -98
  341. package/src/commands/UpdateHITReviewStatusCommand.ts +0 -99
  342. package/src/commands/UpdateHITTypeOfHITCommand.ts +0 -102
  343. package/src/commands/UpdateNotificationSettingsCommand.ts +0 -109
  344. package/src/commands/UpdateQualificationTypeCommand.ts +0 -127
  345. package/src/endpoints.ts +0 -62
  346. package/src/index.ts +0 -53
  347. package/src/models/index.ts +0 -1
  348. package/src/models/models_0.ts +0 -3412
  349. package/src/pagination/Interfaces.ts +0 -8
  350. package/src/pagination/ListAssignmentsForHITPaginator.ts +0 -59
  351. package/src/pagination/ListBonusPaymentsPaginator.ts +0 -59
  352. package/src/pagination/ListHITsForQualificationTypePaginator.ts +0 -59
  353. package/src/pagination/ListHITsPaginator.ts +0 -55
  354. package/src/pagination/ListQualificationRequestsPaginator.ts +0 -59
  355. package/src/pagination/ListQualificationTypesPaginator.ts +0 -59
  356. package/src/pagination/ListReviewPolicyResultsForHITPaginator.ts +0 -59
  357. package/src/pagination/ListReviewableHITsPaginator.ts +0 -59
  358. package/src/pagination/ListWorkerBlocksPaginator.ts +0 -59
  359. package/src/pagination/ListWorkersWithQualificationTypePaginator.ts +0 -59
  360. package/src/protocols/Aws_json1_1.ts +0 -4803
  361. package/src/runtimeConfig.browser.ts +0 -41
  362. package/src/runtimeConfig.native.ts +0 -17
  363. package/src/runtimeConfig.shared.ts +0 -17
  364. package/src/runtimeConfig.ts +0 -46
  365. package/tsconfig.es.json +0 -10
  366. package/tsconfig.json +0 -33
  367. package/tsconfig.types.json +0 -9
@@ -1,4803 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectBoolean as __expectBoolean,
4
- expectInt32 as __expectInt32,
5
- expectLong as __expectLong,
6
- expectNonNull as __expectNonNull,
7
- expectNumber as __expectNumber,
8
- expectString as __expectString,
9
- parseEpochTimestamp as __parseEpochTimestamp,
10
- } from "@aws-sdk/smithy-client";
11
- import {
12
- Endpoint as __Endpoint,
13
- HeaderBag as __HeaderBag,
14
- MetadataBearer as __MetadataBearer,
15
- ResponseMetadata as __ResponseMetadata,
16
- SerdeContext as __SerdeContext,
17
- SmithyException as __SmithyException,
18
- } from "@aws-sdk/types";
19
-
20
- import {
21
- AcceptQualificationRequestCommandInput,
22
- AcceptQualificationRequestCommandOutput,
23
- } from "../commands/AcceptQualificationRequestCommand";
24
- import { ApproveAssignmentCommandInput, ApproveAssignmentCommandOutput } from "../commands/ApproveAssignmentCommand";
25
- import {
26
- AssociateQualificationWithWorkerCommandInput,
27
- AssociateQualificationWithWorkerCommandOutput,
28
- } from "../commands/AssociateQualificationWithWorkerCommand";
29
- import {
30
- CreateAdditionalAssignmentsForHITCommandInput,
31
- CreateAdditionalAssignmentsForHITCommandOutput,
32
- } from "../commands/CreateAdditionalAssignmentsForHITCommand";
33
- import { CreateHITCommandInput, CreateHITCommandOutput } from "../commands/CreateHITCommand";
34
- import { CreateHITTypeCommandInput, CreateHITTypeCommandOutput } from "../commands/CreateHITTypeCommand";
35
- import {
36
- CreateHITWithHITTypeCommandInput,
37
- CreateHITWithHITTypeCommandOutput,
38
- } from "../commands/CreateHITWithHITTypeCommand";
39
- import {
40
- CreateQualificationTypeCommandInput,
41
- CreateQualificationTypeCommandOutput,
42
- } from "../commands/CreateQualificationTypeCommand";
43
- import { CreateWorkerBlockCommandInput, CreateWorkerBlockCommandOutput } from "../commands/CreateWorkerBlockCommand";
44
- import { DeleteHITCommandInput, DeleteHITCommandOutput } from "../commands/DeleteHITCommand";
45
- import {
46
- DeleteQualificationTypeCommandInput,
47
- DeleteQualificationTypeCommandOutput,
48
- } from "../commands/DeleteQualificationTypeCommand";
49
- import { DeleteWorkerBlockCommandInput, DeleteWorkerBlockCommandOutput } from "../commands/DeleteWorkerBlockCommand";
50
- import {
51
- DisassociateQualificationFromWorkerCommandInput,
52
- DisassociateQualificationFromWorkerCommandOutput,
53
- } from "../commands/DisassociateQualificationFromWorkerCommand";
54
- import { GetAccountBalanceCommandInput, GetAccountBalanceCommandOutput } from "../commands/GetAccountBalanceCommand";
55
- import { GetAssignmentCommandInput, GetAssignmentCommandOutput } from "../commands/GetAssignmentCommand";
56
- import { GetFileUploadURLCommandInput, GetFileUploadURLCommandOutput } from "../commands/GetFileUploadURLCommand";
57
- import { GetHITCommandInput, GetHITCommandOutput } from "../commands/GetHITCommand";
58
- import {
59
- GetQualificationScoreCommandInput,
60
- GetQualificationScoreCommandOutput,
61
- } from "../commands/GetQualificationScoreCommand";
62
- import {
63
- GetQualificationTypeCommandInput,
64
- GetQualificationTypeCommandOutput,
65
- } from "../commands/GetQualificationTypeCommand";
66
- import {
67
- ListAssignmentsForHITCommandInput,
68
- ListAssignmentsForHITCommandOutput,
69
- } from "../commands/ListAssignmentsForHITCommand";
70
- import { ListBonusPaymentsCommandInput, ListBonusPaymentsCommandOutput } from "../commands/ListBonusPaymentsCommand";
71
- import { ListHITsCommandInput, ListHITsCommandOutput } from "../commands/ListHITsCommand";
72
- import {
73
- ListHITsForQualificationTypeCommandInput,
74
- ListHITsForQualificationTypeCommandOutput,
75
- } from "../commands/ListHITsForQualificationTypeCommand";
76
- import {
77
- ListQualificationRequestsCommandInput,
78
- ListQualificationRequestsCommandOutput,
79
- } from "../commands/ListQualificationRequestsCommand";
80
- import {
81
- ListQualificationTypesCommandInput,
82
- ListQualificationTypesCommandOutput,
83
- } from "../commands/ListQualificationTypesCommand";
84
- import { ListReviewableHITsCommandInput, ListReviewableHITsCommandOutput } from "../commands/ListReviewableHITsCommand";
85
- import {
86
- ListReviewPolicyResultsForHITCommandInput,
87
- ListReviewPolicyResultsForHITCommandOutput,
88
- } from "../commands/ListReviewPolicyResultsForHITCommand";
89
- import { ListWorkerBlocksCommandInput, ListWorkerBlocksCommandOutput } from "../commands/ListWorkerBlocksCommand";
90
- import {
91
- ListWorkersWithQualificationTypeCommandInput,
92
- ListWorkersWithQualificationTypeCommandOutput,
93
- } from "../commands/ListWorkersWithQualificationTypeCommand";
94
- import { NotifyWorkersCommandInput, NotifyWorkersCommandOutput } from "../commands/NotifyWorkersCommand";
95
- import { RejectAssignmentCommandInput, RejectAssignmentCommandOutput } from "../commands/RejectAssignmentCommand";
96
- import {
97
- RejectQualificationRequestCommandInput,
98
- RejectQualificationRequestCommandOutput,
99
- } from "../commands/RejectQualificationRequestCommand";
100
- import { SendBonusCommandInput, SendBonusCommandOutput } from "../commands/SendBonusCommand";
101
- import {
102
- SendTestEventNotificationCommandInput,
103
- SendTestEventNotificationCommandOutput,
104
- } from "../commands/SendTestEventNotificationCommand";
105
- import {
106
- UpdateExpirationForHITCommandInput,
107
- UpdateExpirationForHITCommandOutput,
108
- } from "../commands/UpdateExpirationForHITCommand";
109
- import {
110
- UpdateHITReviewStatusCommandInput,
111
- UpdateHITReviewStatusCommandOutput,
112
- } from "../commands/UpdateHITReviewStatusCommand";
113
- import { UpdateHITTypeOfHITCommandInput, UpdateHITTypeOfHITCommandOutput } from "../commands/UpdateHITTypeOfHITCommand";
114
- import {
115
- UpdateNotificationSettingsCommandInput,
116
- UpdateNotificationSettingsCommandOutput,
117
- } from "../commands/UpdateNotificationSettingsCommand";
118
- import {
119
- UpdateQualificationTypeCommandInput,
120
- UpdateQualificationTypeCommandOutput,
121
- } from "../commands/UpdateQualificationTypeCommand";
122
- import {
123
- AcceptQualificationRequestRequest,
124
- AcceptQualificationRequestResponse,
125
- ApproveAssignmentRequest,
126
- ApproveAssignmentResponse,
127
- Assignment,
128
- AssignmentStatus,
129
- AssociateQualificationWithWorkerRequest,
130
- AssociateQualificationWithWorkerResponse,
131
- BonusPayment,
132
- CreateAdditionalAssignmentsForHITRequest,
133
- CreateAdditionalAssignmentsForHITResponse,
134
- CreateHITRequest,
135
- CreateHITResponse,
136
- CreateHITTypeRequest,
137
- CreateHITTypeResponse,
138
- CreateHITWithHITTypeRequest,
139
- CreateHITWithHITTypeResponse,
140
- CreateQualificationTypeRequest,
141
- CreateQualificationTypeResponse,
142
- CreateWorkerBlockRequest,
143
- CreateWorkerBlockResponse,
144
- DeleteHITRequest,
145
- DeleteHITResponse,
146
- DeleteQualificationTypeRequest,
147
- DeleteQualificationTypeResponse,
148
- DeleteWorkerBlockRequest,
149
- DeleteWorkerBlockResponse,
150
- DisassociateQualificationFromWorkerRequest,
151
- DisassociateQualificationFromWorkerResponse,
152
- EventType,
153
- GetAccountBalanceRequest,
154
- GetAccountBalanceResponse,
155
- GetAssignmentRequest,
156
- GetAssignmentResponse,
157
- GetFileUploadURLRequest,
158
- GetFileUploadURLResponse,
159
- GetHITRequest,
160
- GetHITResponse,
161
- GetQualificationScoreRequest,
162
- GetQualificationScoreResponse,
163
- GetQualificationTypeRequest,
164
- GetQualificationTypeResponse,
165
- HIT,
166
- HITLayoutParameter,
167
- ListAssignmentsForHITRequest,
168
- ListAssignmentsForHITResponse,
169
- ListBonusPaymentsRequest,
170
- ListBonusPaymentsResponse,
171
- ListHITsForQualificationTypeRequest,
172
- ListHITsForQualificationTypeResponse,
173
- ListHITsRequest,
174
- ListHITsResponse,
175
- ListQualificationRequestsRequest,
176
- ListQualificationRequestsResponse,
177
- ListQualificationTypesRequest,
178
- ListQualificationTypesResponse,
179
- ListReviewableHITsRequest,
180
- ListReviewableHITsResponse,
181
- ListReviewPolicyResultsForHITRequest,
182
- ListReviewPolicyResultsForHITResponse,
183
- ListWorkerBlocksRequest,
184
- ListWorkerBlocksResponse,
185
- ListWorkersWithQualificationTypeRequest,
186
- ListWorkersWithQualificationTypeResponse,
187
- Locale,
188
- NotificationSpecification,
189
- NotifyWorkersFailureStatus,
190
- NotifyWorkersRequest,
191
- NotifyWorkersResponse,
192
- ParameterMapEntry,
193
- PolicyParameter,
194
- Qualification,
195
- QualificationRequest,
196
- QualificationRequirement,
197
- QualificationType,
198
- RejectAssignmentRequest,
199
- RejectAssignmentResponse,
200
- RejectQualificationRequestRequest,
201
- RejectQualificationRequestResponse,
202
- RequestError,
203
- ReviewActionDetail,
204
- ReviewPolicy,
205
- ReviewPolicyLevel,
206
- ReviewReport,
207
- ReviewResultDetail,
208
- SendBonusRequest,
209
- SendBonusResponse,
210
- SendTestEventNotificationRequest,
211
- SendTestEventNotificationResponse,
212
- ServiceFault,
213
- UpdateExpirationForHITRequest,
214
- UpdateExpirationForHITResponse,
215
- UpdateHITReviewStatusRequest,
216
- UpdateHITReviewStatusResponse,
217
- UpdateHITTypeOfHITRequest,
218
- UpdateHITTypeOfHITResponse,
219
- UpdateNotificationSettingsRequest,
220
- UpdateNotificationSettingsResponse,
221
- UpdateQualificationTypeRequest,
222
- UpdateQualificationTypeResponse,
223
- WorkerBlock,
224
- } from "../models/models_0";
225
-
226
- export const serializeAws_json1_1AcceptQualificationRequestCommand = async (
227
- input: AcceptQualificationRequestCommandInput,
228
- context: __SerdeContext
229
- ): Promise<__HttpRequest> => {
230
- const headers: __HeaderBag = {
231
- "content-type": "application/x-amz-json-1.1",
232
- "x-amz-target": "MTurkRequesterServiceV20170117.AcceptQualificationRequest",
233
- };
234
- let body: any;
235
- body = JSON.stringify(serializeAws_json1_1AcceptQualificationRequestRequest(input, context));
236
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
237
- };
238
-
239
- export const serializeAws_json1_1ApproveAssignmentCommand = async (
240
- input: ApproveAssignmentCommandInput,
241
- context: __SerdeContext
242
- ): Promise<__HttpRequest> => {
243
- const headers: __HeaderBag = {
244
- "content-type": "application/x-amz-json-1.1",
245
- "x-amz-target": "MTurkRequesterServiceV20170117.ApproveAssignment",
246
- };
247
- let body: any;
248
- body = JSON.stringify(serializeAws_json1_1ApproveAssignmentRequest(input, context));
249
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
250
- };
251
-
252
- export const serializeAws_json1_1AssociateQualificationWithWorkerCommand = async (
253
- input: AssociateQualificationWithWorkerCommandInput,
254
- context: __SerdeContext
255
- ): Promise<__HttpRequest> => {
256
- const headers: __HeaderBag = {
257
- "content-type": "application/x-amz-json-1.1",
258
- "x-amz-target": "MTurkRequesterServiceV20170117.AssociateQualificationWithWorker",
259
- };
260
- let body: any;
261
- body = JSON.stringify(serializeAws_json1_1AssociateQualificationWithWorkerRequest(input, context));
262
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
263
- };
264
-
265
- export const serializeAws_json1_1CreateAdditionalAssignmentsForHITCommand = async (
266
- input: CreateAdditionalAssignmentsForHITCommandInput,
267
- context: __SerdeContext
268
- ): Promise<__HttpRequest> => {
269
- const headers: __HeaderBag = {
270
- "content-type": "application/x-amz-json-1.1",
271
- "x-amz-target": "MTurkRequesterServiceV20170117.CreateAdditionalAssignmentsForHIT",
272
- };
273
- let body: any;
274
- body = JSON.stringify(serializeAws_json1_1CreateAdditionalAssignmentsForHITRequest(input, context));
275
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
276
- };
277
-
278
- export const serializeAws_json1_1CreateHITCommand = async (
279
- input: CreateHITCommandInput,
280
- context: __SerdeContext
281
- ): Promise<__HttpRequest> => {
282
- const headers: __HeaderBag = {
283
- "content-type": "application/x-amz-json-1.1",
284
- "x-amz-target": "MTurkRequesterServiceV20170117.CreateHIT",
285
- };
286
- let body: any;
287
- body = JSON.stringify(serializeAws_json1_1CreateHITRequest(input, context));
288
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
289
- };
290
-
291
- export const serializeAws_json1_1CreateHITTypeCommand = async (
292
- input: CreateHITTypeCommandInput,
293
- context: __SerdeContext
294
- ): Promise<__HttpRequest> => {
295
- const headers: __HeaderBag = {
296
- "content-type": "application/x-amz-json-1.1",
297
- "x-amz-target": "MTurkRequesterServiceV20170117.CreateHITType",
298
- };
299
- let body: any;
300
- body = JSON.stringify(serializeAws_json1_1CreateHITTypeRequest(input, context));
301
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
302
- };
303
-
304
- export const serializeAws_json1_1CreateHITWithHITTypeCommand = async (
305
- input: CreateHITWithHITTypeCommandInput,
306
- context: __SerdeContext
307
- ): Promise<__HttpRequest> => {
308
- const headers: __HeaderBag = {
309
- "content-type": "application/x-amz-json-1.1",
310
- "x-amz-target": "MTurkRequesterServiceV20170117.CreateHITWithHITType",
311
- };
312
- let body: any;
313
- body = JSON.stringify(serializeAws_json1_1CreateHITWithHITTypeRequest(input, context));
314
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
315
- };
316
-
317
- export const serializeAws_json1_1CreateQualificationTypeCommand = async (
318
- input: CreateQualificationTypeCommandInput,
319
- context: __SerdeContext
320
- ): Promise<__HttpRequest> => {
321
- const headers: __HeaderBag = {
322
- "content-type": "application/x-amz-json-1.1",
323
- "x-amz-target": "MTurkRequesterServiceV20170117.CreateQualificationType",
324
- };
325
- let body: any;
326
- body = JSON.stringify(serializeAws_json1_1CreateQualificationTypeRequest(input, context));
327
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
328
- };
329
-
330
- export const serializeAws_json1_1CreateWorkerBlockCommand = async (
331
- input: CreateWorkerBlockCommandInput,
332
- context: __SerdeContext
333
- ): Promise<__HttpRequest> => {
334
- const headers: __HeaderBag = {
335
- "content-type": "application/x-amz-json-1.1",
336
- "x-amz-target": "MTurkRequesterServiceV20170117.CreateWorkerBlock",
337
- };
338
- let body: any;
339
- body = JSON.stringify(serializeAws_json1_1CreateWorkerBlockRequest(input, context));
340
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
341
- };
342
-
343
- export const serializeAws_json1_1DeleteHITCommand = async (
344
- input: DeleteHITCommandInput,
345
- context: __SerdeContext
346
- ): Promise<__HttpRequest> => {
347
- const headers: __HeaderBag = {
348
- "content-type": "application/x-amz-json-1.1",
349
- "x-amz-target": "MTurkRequesterServiceV20170117.DeleteHIT",
350
- };
351
- let body: any;
352
- body = JSON.stringify(serializeAws_json1_1DeleteHITRequest(input, context));
353
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
354
- };
355
-
356
- export const serializeAws_json1_1DeleteQualificationTypeCommand = async (
357
- input: DeleteQualificationTypeCommandInput,
358
- context: __SerdeContext
359
- ): Promise<__HttpRequest> => {
360
- const headers: __HeaderBag = {
361
- "content-type": "application/x-amz-json-1.1",
362
- "x-amz-target": "MTurkRequesterServiceV20170117.DeleteQualificationType",
363
- };
364
- let body: any;
365
- body = JSON.stringify(serializeAws_json1_1DeleteQualificationTypeRequest(input, context));
366
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
367
- };
368
-
369
- export const serializeAws_json1_1DeleteWorkerBlockCommand = async (
370
- input: DeleteWorkerBlockCommandInput,
371
- context: __SerdeContext
372
- ): Promise<__HttpRequest> => {
373
- const headers: __HeaderBag = {
374
- "content-type": "application/x-amz-json-1.1",
375
- "x-amz-target": "MTurkRequesterServiceV20170117.DeleteWorkerBlock",
376
- };
377
- let body: any;
378
- body = JSON.stringify(serializeAws_json1_1DeleteWorkerBlockRequest(input, context));
379
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
380
- };
381
-
382
- export const serializeAws_json1_1DisassociateQualificationFromWorkerCommand = async (
383
- input: DisassociateQualificationFromWorkerCommandInput,
384
- context: __SerdeContext
385
- ): Promise<__HttpRequest> => {
386
- const headers: __HeaderBag = {
387
- "content-type": "application/x-amz-json-1.1",
388
- "x-amz-target": "MTurkRequesterServiceV20170117.DisassociateQualificationFromWorker",
389
- };
390
- let body: any;
391
- body = JSON.stringify(serializeAws_json1_1DisassociateQualificationFromWorkerRequest(input, context));
392
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
393
- };
394
-
395
- export const serializeAws_json1_1GetAccountBalanceCommand = async (
396
- input: GetAccountBalanceCommandInput,
397
- context: __SerdeContext
398
- ): Promise<__HttpRequest> => {
399
- const headers: __HeaderBag = {
400
- "content-type": "application/x-amz-json-1.1",
401
- "x-amz-target": "MTurkRequesterServiceV20170117.GetAccountBalance",
402
- };
403
- let body: any;
404
- body = JSON.stringify(serializeAws_json1_1GetAccountBalanceRequest(input, context));
405
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
406
- };
407
-
408
- export const serializeAws_json1_1GetAssignmentCommand = async (
409
- input: GetAssignmentCommandInput,
410
- context: __SerdeContext
411
- ): Promise<__HttpRequest> => {
412
- const headers: __HeaderBag = {
413
- "content-type": "application/x-amz-json-1.1",
414
- "x-amz-target": "MTurkRequesterServiceV20170117.GetAssignment",
415
- };
416
- let body: any;
417
- body = JSON.stringify(serializeAws_json1_1GetAssignmentRequest(input, context));
418
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
419
- };
420
-
421
- export const serializeAws_json1_1GetFileUploadURLCommand = async (
422
- input: GetFileUploadURLCommandInput,
423
- context: __SerdeContext
424
- ): Promise<__HttpRequest> => {
425
- const headers: __HeaderBag = {
426
- "content-type": "application/x-amz-json-1.1",
427
- "x-amz-target": "MTurkRequesterServiceV20170117.GetFileUploadURL",
428
- };
429
- let body: any;
430
- body = JSON.stringify(serializeAws_json1_1GetFileUploadURLRequest(input, context));
431
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
432
- };
433
-
434
- export const serializeAws_json1_1GetHITCommand = async (
435
- input: GetHITCommandInput,
436
- context: __SerdeContext
437
- ): Promise<__HttpRequest> => {
438
- const headers: __HeaderBag = {
439
- "content-type": "application/x-amz-json-1.1",
440
- "x-amz-target": "MTurkRequesterServiceV20170117.GetHIT",
441
- };
442
- let body: any;
443
- body = JSON.stringify(serializeAws_json1_1GetHITRequest(input, context));
444
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
445
- };
446
-
447
- export const serializeAws_json1_1GetQualificationScoreCommand = async (
448
- input: GetQualificationScoreCommandInput,
449
- context: __SerdeContext
450
- ): Promise<__HttpRequest> => {
451
- const headers: __HeaderBag = {
452
- "content-type": "application/x-amz-json-1.1",
453
- "x-amz-target": "MTurkRequesterServiceV20170117.GetQualificationScore",
454
- };
455
- let body: any;
456
- body = JSON.stringify(serializeAws_json1_1GetQualificationScoreRequest(input, context));
457
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
458
- };
459
-
460
- export const serializeAws_json1_1GetQualificationTypeCommand = async (
461
- input: GetQualificationTypeCommandInput,
462
- context: __SerdeContext
463
- ): Promise<__HttpRequest> => {
464
- const headers: __HeaderBag = {
465
- "content-type": "application/x-amz-json-1.1",
466
- "x-amz-target": "MTurkRequesterServiceV20170117.GetQualificationType",
467
- };
468
- let body: any;
469
- body = JSON.stringify(serializeAws_json1_1GetQualificationTypeRequest(input, context));
470
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
471
- };
472
-
473
- export const serializeAws_json1_1ListAssignmentsForHITCommand = async (
474
- input: ListAssignmentsForHITCommandInput,
475
- context: __SerdeContext
476
- ): Promise<__HttpRequest> => {
477
- const headers: __HeaderBag = {
478
- "content-type": "application/x-amz-json-1.1",
479
- "x-amz-target": "MTurkRequesterServiceV20170117.ListAssignmentsForHIT",
480
- };
481
- let body: any;
482
- body = JSON.stringify(serializeAws_json1_1ListAssignmentsForHITRequest(input, context));
483
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
484
- };
485
-
486
- export const serializeAws_json1_1ListBonusPaymentsCommand = async (
487
- input: ListBonusPaymentsCommandInput,
488
- context: __SerdeContext
489
- ): Promise<__HttpRequest> => {
490
- const headers: __HeaderBag = {
491
- "content-type": "application/x-amz-json-1.1",
492
- "x-amz-target": "MTurkRequesterServiceV20170117.ListBonusPayments",
493
- };
494
- let body: any;
495
- body = JSON.stringify(serializeAws_json1_1ListBonusPaymentsRequest(input, context));
496
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
497
- };
498
-
499
- export const serializeAws_json1_1ListHITsCommand = async (
500
- input: ListHITsCommandInput,
501
- context: __SerdeContext
502
- ): Promise<__HttpRequest> => {
503
- const headers: __HeaderBag = {
504
- "content-type": "application/x-amz-json-1.1",
505
- "x-amz-target": "MTurkRequesterServiceV20170117.ListHITs",
506
- };
507
- let body: any;
508
- body = JSON.stringify(serializeAws_json1_1ListHITsRequest(input, context));
509
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
510
- };
511
-
512
- export const serializeAws_json1_1ListHITsForQualificationTypeCommand = async (
513
- input: ListHITsForQualificationTypeCommandInput,
514
- context: __SerdeContext
515
- ): Promise<__HttpRequest> => {
516
- const headers: __HeaderBag = {
517
- "content-type": "application/x-amz-json-1.1",
518
- "x-amz-target": "MTurkRequesterServiceV20170117.ListHITsForQualificationType",
519
- };
520
- let body: any;
521
- body = JSON.stringify(serializeAws_json1_1ListHITsForQualificationTypeRequest(input, context));
522
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
523
- };
524
-
525
- export const serializeAws_json1_1ListQualificationRequestsCommand = async (
526
- input: ListQualificationRequestsCommandInput,
527
- context: __SerdeContext
528
- ): Promise<__HttpRequest> => {
529
- const headers: __HeaderBag = {
530
- "content-type": "application/x-amz-json-1.1",
531
- "x-amz-target": "MTurkRequesterServiceV20170117.ListQualificationRequests",
532
- };
533
- let body: any;
534
- body = JSON.stringify(serializeAws_json1_1ListQualificationRequestsRequest(input, context));
535
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
536
- };
537
-
538
- export const serializeAws_json1_1ListQualificationTypesCommand = async (
539
- input: ListQualificationTypesCommandInput,
540
- context: __SerdeContext
541
- ): Promise<__HttpRequest> => {
542
- const headers: __HeaderBag = {
543
- "content-type": "application/x-amz-json-1.1",
544
- "x-amz-target": "MTurkRequesterServiceV20170117.ListQualificationTypes",
545
- };
546
- let body: any;
547
- body = JSON.stringify(serializeAws_json1_1ListQualificationTypesRequest(input, context));
548
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
549
- };
550
-
551
- export const serializeAws_json1_1ListReviewableHITsCommand = async (
552
- input: ListReviewableHITsCommandInput,
553
- context: __SerdeContext
554
- ): Promise<__HttpRequest> => {
555
- const headers: __HeaderBag = {
556
- "content-type": "application/x-amz-json-1.1",
557
- "x-amz-target": "MTurkRequesterServiceV20170117.ListReviewableHITs",
558
- };
559
- let body: any;
560
- body = JSON.stringify(serializeAws_json1_1ListReviewableHITsRequest(input, context));
561
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
562
- };
563
-
564
- export const serializeAws_json1_1ListReviewPolicyResultsForHITCommand = async (
565
- input: ListReviewPolicyResultsForHITCommandInput,
566
- context: __SerdeContext
567
- ): Promise<__HttpRequest> => {
568
- const headers: __HeaderBag = {
569
- "content-type": "application/x-amz-json-1.1",
570
- "x-amz-target": "MTurkRequesterServiceV20170117.ListReviewPolicyResultsForHIT",
571
- };
572
- let body: any;
573
- body = JSON.stringify(serializeAws_json1_1ListReviewPolicyResultsForHITRequest(input, context));
574
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
575
- };
576
-
577
- export const serializeAws_json1_1ListWorkerBlocksCommand = async (
578
- input: ListWorkerBlocksCommandInput,
579
- context: __SerdeContext
580
- ): Promise<__HttpRequest> => {
581
- const headers: __HeaderBag = {
582
- "content-type": "application/x-amz-json-1.1",
583
- "x-amz-target": "MTurkRequesterServiceV20170117.ListWorkerBlocks",
584
- };
585
- let body: any;
586
- body = JSON.stringify(serializeAws_json1_1ListWorkerBlocksRequest(input, context));
587
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
588
- };
589
-
590
- export const serializeAws_json1_1ListWorkersWithQualificationTypeCommand = async (
591
- input: ListWorkersWithQualificationTypeCommandInput,
592
- context: __SerdeContext
593
- ): Promise<__HttpRequest> => {
594
- const headers: __HeaderBag = {
595
- "content-type": "application/x-amz-json-1.1",
596
- "x-amz-target": "MTurkRequesterServiceV20170117.ListWorkersWithQualificationType",
597
- };
598
- let body: any;
599
- body = JSON.stringify(serializeAws_json1_1ListWorkersWithQualificationTypeRequest(input, context));
600
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
601
- };
602
-
603
- export const serializeAws_json1_1NotifyWorkersCommand = async (
604
- input: NotifyWorkersCommandInput,
605
- context: __SerdeContext
606
- ): Promise<__HttpRequest> => {
607
- const headers: __HeaderBag = {
608
- "content-type": "application/x-amz-json-1.1",
609
- "x-amz-target": "MTurkRequesterServiceV20170117.NotifyWorkers",
610
- };
611
- let body: any;
612
- body = JSON.stringify(serializeAws_json1_1NotifyWorkersRequest(input, context));
613
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
614
- };
615
-
616
- export const serializeAws_json1_1RejectAssignmentCommand = async (
617
- input: RejectAssignmentCommandInput,
618
- context: __SerdeContext
619
- ): Promise<__HttpRequest> => {
620
- const headers: __HeaderBag = {
621
- "content-type": "application/x-amz-json-1.1",
622
- "x-amz-target": "MTurkRequesterServiceV20170117.RejectAssignment",
623
- };
624
- let body: any;
625
- body = JSON.stringify(serializeAws_json1_1RejectAssignmentRequest(input, context));
626
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
627
- };
628
-
629
- export const serializeAws_json1_1RejectQualificationRequestCommand = async (
630
- input: RejectQualificationRequestCommandInput,
631
- context: __SerdeContext
632
- ): Promise<__HttpRequest> => {
633
- const headers: __HeaderBag = {
634
- "content-type": "application/x-amz-json-1.1",
635
- "x-amz-target": "MTurkRequesterServiceV20170117.RejectQualificationRequest",
636
- };
637
- let body: any;
638
- body = JSON.stringify(serializeAws_json1_1RejectQualificationRequestRequest(input, context));
639
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
640
- };
641
-
642
- export const serializeAws_json1_1SendBonusCommand = async (
643
- input: SendBonusCommandInput,
644
- context: __SerdeContext
645
- ): Promise<__HttpRequest> => {
646
- const headers: __HeaderBag = {
647
- "content-type": "application/x-amz-json-1.1",
648
- "x-amz-target": "MTurkRequesterServiceV20170117.SendBonus",
649
- };
650
- let body: any;
651
- body = JSON.stringify(serializeAws_json1_1SendBonusRequest(input, context));
652
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
653
- };
654
-
655
- export const serializeAws_json1_1SendTestEventNotificationCommand = async (
656
- input: SendTestEventNotificationCommandInput,
657
- context: __SerdeContext
658
- ): Promise<__HttpRequest> => {
659
- const headers: __HeaderBag = {
660
- "content-type": "application/x-amz-json-1.1",
661
- "x-amz-target": "MTurkRequesterServiceV20170117.SendTestEventNotification",
662
- };
663
- let body: any;
664
- body = JSON.stringify(serializeAws_json1_1SendTestEventNotificationRequest(input, context));
665
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
666
- };
667
-
668
- export const serializeAws_json1_1UpdateExpirationForHITCommand = async (
669
- input: UpdateExpirationForHITCommandInput,
670
- context: __SerdeContext
671
- ): Promise<__HttpRequest> => {
672
- const headers: __HeaderBag = {
673
- "content-type": "application/x-amz-json-1.1",
674
- "x-amz-target": "MTurkRequesterServiceV20170117.UpdateExpirationForHIT",
675
- };
676
- let body: any;
677
- body = JSON.stringify(serializeAws_json1_1UpdateExpirationForHITRequest(input, context));
678
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
679
- };
680
-
681
- export const serializeAws_json1_1UpdateHITReviewStatusCommand = async (
682
- input: UpdateHITReviewStatusCommandInput,
683
- context: __SerdeContext
684
- ): Promise<__HttpRequest> => {
685
- const headers: __HeaderBag = {
686
- "content-type": "application/x-amz-json-1.1",
687
- "x-amz-target": "MTurkRequesterServiceV20170117.UpdateHITReviewStatus",
688
- };
689
- let body: any;
690
- body = JSON.stringify(serializeAws_json1_1UpdateHITReviewStatusRequest(input, context));
691
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
692
- };
693
-
694
- export const serializeAws_json1_1UpdateHITTypeOfHITCommand = async (
695
- input: UpdateHITTypeOfHITCommandInput,
696
- context: __SerdeContext
697
- ): Promise<__HttpRequest> => {
698
- const headers: __HeaderBag = {
699
- "content-type": "application/x-amz-json-1.1",
700
- "x-amz-target": "MTurkRequesterServiceV20170117.UpdateHITTypeOfHIT",
701
- };
702
- let body: any;
703
- body = JSON.stringify(serializeAws_json1_1UpdateHITTypeOfHITRequest(input, context));
704
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
705
- };
706
-
707
- export const serializeAws_json1_1UpdateNotificationSettingsCommand = async (
708
- input: UpdateNotificationSettingsCommandInput,
709
- context: __SerdeContext
710
- ): Promise<__HttpRequest> => {
711
- const headers: __HeaderBag = {
712
- "content-type": "application/x-amz-json-1.1",
713
- "x-amz-target": "MTurkRequesterServiceV20170117.UpdateNotificationSettings",
714
- };
715
- let body: any;
716
- body = JSON.stringify(serializeAws_json1_1UpdateNotificationSettingsRequest(input, context));
717
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
718
- };
719
-
720
- export const serializeAws_json1_1UpdateQualificationTypeCommand = async (
721
- input: UpdateQualificationTypeCommandInput,
722
- context: __SerdeContext
723
- ): Promise<__HttpRequest> => {
724
- const headers: __HeaderBag = {
725
- "content-type": "application/x-amz-json-1.1",
726
- "x-amz-target": "MTurkRequesterServiceV20170117.UpdateQualificationType",
727
- };
728
- let body: any;
729
- body = JSON.stringify(serializeAws_json1_1UpdateQualificationTypeRequest(input, context));
730
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
731
- };
732
-
733
- export const deserializeAws_json1_1AcceptQualificationRequestCommand = async (
734
- output: __HttpResponse,
735
- context: __SerdeContext
736
- ): Promise<AcceptQualificationRequestCommandOutput> => {
737
- if (output.statusCode >= 300) {
738
- return deserializeAws_json1_1AcceptQualificationRequestCommandError(output, context);
739
- }
740
- const data: any = await parseBody(output.body, context);
741
- let contents: any = {};
742
- contents = deserializeAws_json1_1AcceptQualificationRequestResponse(data, context);
743
- const response: AcceptQualificationRequestCommandOutput = {
744
- $metadata: deserializeMetadata(output),
745
- ...contents,
746
- };
747
- return Promise.resolve(response);
748
- };
749
-
750
- const deserializeAws_json1_1AcceptQualificationRequestCommandError = async (
751
- output: __HttpResponse,
752
- context: __SerdeContext
753
- ): Promise<AcceptQualificationRequestCommandOutput> => {
754
- const parsedOutput: any = {
755
- ...output,
756
- body: await parseBody(output.body, context),
757
- };
758
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
759
- let errorCode = "UnknownError";
760
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
761
- switch (errorCode) {
762
- case "RequestError":
763
- case "com.amazonaws.mturk#RequestError":
764
- response = {
765
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
766
- name: errorCode,
767
- $metadata: deserializeMetadata(output),
768
- };
769
- break;
770
- case "ServiceFault":
771
- case "com.amazonaws.mturk#ServiceFault":
772
- response = {
773
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
774
- name: errorCode,
775
- $metadata: deserializeMetadata(output),
776
- };
777
- break;
778
- default:
779
- const parsedBody = parsedOutput.body;
780
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
781
- response = {
782
- ...parsedBody,
783
- name: `${errorCode}`,
784
- message: parsedBody.message || parsedBody.Message || errorCode,
785
- $fault: "client",
786
- $metadata: deserializeMetadata(output),
787
- } as any;
788
- }
789
- const message = response.message || response.Message || errorCode;
790
- response.message = message;
791
- delete response.Message;
792
- return Promise.reject(Object.assign(new Error(message), response));
793
- };
794
-
795
- export const deserializeAws_json1_1ApproveAssignmentCommand = async (
796
- output: __HttpResponse,
797
- context: __SerdeContext
798
- ): Promise<ApproveAssignmentCommandOutput> => {
799
- if (output.statusCode >= 300) {
800
- return deserializeAws_json1_1ApproveAssignmentCommandError(output, context);
801
- }
802
- const data: any = await parseBody(output.body, context);
803
- let contents: any = {};
804
- contents = deserializeAws_json1_1ApproveAssignmentResponse(data, context);
805
- const response: ApproveAssignmentCommandOutput = {
806
- $metadata: deserializeMetadata(output),
807
- ...contents,
808
- };
809
- return Promise.resolve(response);
810
- };
811
-
812
- const deserializeAws_json1_1ApproveAssignmentCommandError = async (
813
- output: __HttpResponse,
814
- context: __SerdeContext
815
- ): Promise<ApproveAssignmentCommandOutput> => {
816
- const parsedOutput: any = {
817
- ...output,
818
- body: await parseBody(output.body, context),
819
- };
820
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
821
- let errorCode = "UnknownError";
822
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
823
- switch (errorCode) {
824
- case "RequestError":
825
- case "com.amazonaws.mturk#RequestError":
826
- response = {
827
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
828
- name: errorCode,
829
- $metadata: deserializeMetadata(output),
830
- };
831
- break;
832
- case "ServiceFault":
833
- case "com.amazonaws.mturk#ServiceFault":
834
- response = {
835
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
836
- name: errorCode,
837
- $metadata: deserializeMetadata(output),
838
- };
839
- break;
840
- default:
841
- const parsedBody = parsedOutput.body;
842
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
843
- response = {
844
- ...parsedBody,
845
- name: `${errorCode}`,
846
- message: parsedBody.message || parsedBody.Message || errorCode,
847
- $fault: "client",
848
- $metadata: deserializeMetadata(output),
849
- } as any;
850
- }
851
- const message = response.message || response.Message || errorCode;
852
- response.message = message;
853
- delete response.Message;
854
- return Promise.reject(Object.assign(new Error(message), response));
855
- };
856
-
857
- export const deserializeAws_json1_1AssociateQualificationWithWorkerCommand = async (
858
- output: __HttpResponse,
859
- context: __SerdeContext
860
- ): Promise<AssociateQualificationWithWorkerCommandOutput> => {
861
- if (output.statusCode >= 300) {
862
- return deserializeAws_json1_1AssociateQualificationWithWorkerCommandError(output, context);
863
- }
864
- const data: any = await parseBody(output.body, context);
865
- let contents: any = {};
866
- contents = deserializeAws_json1_1AssociateQualificationWithWorkerResponse(data, context);
867
- const response: AssociateQualificationWithWorkerCommandOutput = {
868
- $metadata: deserializeMetadata(output),
869
- ...contents,
870
- };
871
- return Promise.resolve(response);
872
- };
873
-
874
- const deserializeAws_json1_1AssociateQualificationWithWorkerCommandError = async (
875
- output: __HttpResponse,
876
- context: __SerdeContext
877
- ): Promise<AssociateQualificationWithWorkerCommandOutput> => {
878
- const parsedOutput: any = {
879
- ...output,
880
- body: await parseBody(output.body, context),
881
- };
882
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
883
- let errorCode = "UnknownError";
884
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
885
- switch (errorCode) {
886
- case "RequestError":
887
- case "com.amazonaws.mturk#RequestError":
888
- response = {
889
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
890
- name: errorCode,
891
- $metadata: deserializeMetadata(output),
892
- };
893
- break;
894
- case "ServiceFault":
895
- case "com.amazonaws.mturk#ServiceFault":
896
- response = {
897
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
898
- name: errorCode,
899
- $metadata: deserializeMetadata(output),
900
- };
901
- break;
902
- default:
903
- const parsedBody = parsedOutput.body;
904
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
905
- response = {
906
- ...parsedBody,
907
- name: `${errorCode}`,
908
- message: parsedBody.message || parsedBody.Message || errorCode,
909
- $fault: "client",
910
- $metadata: deserializeMetadata(output),
911
- } as any;
912
- }
913
- const message = response.message || response.Message || errorCode;
914
- response.message = message;
915
- delete response.Message;
916
- return Promise.reject(Object.assign(new Error(message), response));
917
- };
918
-
919
- export const deserializeAws_json1_1CreateAdditionalAssignmentsForHITCommand = async (
920
- output: __HttpResponse,
921
- context: __SerdeContext
922
- ): Promise<CreateAdditionalAssignmentsForHITCommandOutput> => {
923
- if (output.statusCode >= 300) {
924
- return deserializeAws_json1_1CreateAdditionalAssignmentsForHITCommandError(output, context);
925
- }
926
- const data: any = await parseBody(output.body, context);
927
- let contents: any = {};
928
- contents = deserializeAws_json1_1CreateAdditionalAssignmentsForHITResponse(data, context);
929
- const response: CreateAdditionalAssignmentsForHITCommandOutput = {
930
- $metadata: deserializeMetadata(output),
931
- ...contents,
932
- };
933
- return Promise.resolve(response);
934
- };
935
-
936
- const deserializeAws_json1_1CreateAdditionalAssignmentsForHITCommandError = async (
937
- output: __HttpResponse,
938
- context: __SerdeContext
939
- ): Promise<CreateAdditionalAssignmentsForHITCommandOutput> => {
940
- const parsedOutput: any = {
941
- ...output,
942
- body: await parseBody(output.body, context),
943
- };
944
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
945
- let errorCode = "UnknownError";
946
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
947
- switch (errorCode) {
948
- case "RequestError":
949
- case "com.amazonaws.mturk#RequestError":
950
- response = {
951
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
952
- name: errorCode,
953
- $metadata: deserializeMetadata(output),
954
- };
955
- break;
956
- case "ServiceFault":
957
- case "com.amazonaws.mturk#ServiceFault":
958
- response = {
959
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
960
- name: errorCode,
961
- $metadata: deserializeMetadata(output),
962
- };
963
- break;
964
- default:
965
- const parsedBody = parsedOutput.body;
966
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
967
- response = {
968
- ...parsedBody,
969
- name: `${errorCode}`,
970
- message: parsedBody.message || parsedBody.Message || errorCode,
971
- $fault: "client",
972
- $metadata: deserializeMetadata(output),
973
- } as any;
974
- }
975
- const message = response.message || response.Message || errorCode;
976
- response.message = message;
977
- delete response.Message;
978
- return Promise.reject(Object.assign(new Error(message), response));
979
- };
980
-
981
- export const deserializeAws_json1_1CreateHITCommand = async (
982
- output: __HttpResponse,
983
- context: __SerdeContext
984
- ): Promise<CreateHITCommandOutput> => {
985
- if (output.statusCode >= 300) {
986
- return deserializeAws_json1_1CreateHITCommandError(output, context);
987
- }
988
- const data: any = await parseBody(output.body, context);
989
- let contents: any = {};
990
- contents = deserializeAws_json1_1CreateHITResponse(data, context);
991
- const response: CreateHITCommandOutput = {
992
- $metadata: deserializeMetadata(output),
993
- ...contents,
994
- };
995
- return Promise.resolve(response);
996
- };
997
-
998
- const deserializeAws_json1_1CreateHITCommandError = async (
999
- output: __HttpResponse,
1000
- context: __SerdeContext
1001
- ): Promise<CreateHITCommandOutput> => {
1002
- const parsedOutput: any = {
1003
- ...output,
1004
- body: await parseBody(output.body, context),
1005
- };
1006
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1007
- let errorCode = "UnknownError";
1008
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1009
- switch (errorCode) {
1010
- case "RequestError":
1011
- case "com.amazonaws.mturk#RequestError":
1012
- response = {
1013
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1014
- name: errorCode,
1015
- $metadata: deserializeMetadata(output),
1016
- };
1017
- break;
1018
- case "ServiceFault":
1019
- case "com.amazonaws.mturk#ServiceFault":
1020
- response = {
1021
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1022
- name: errorCode,
1023
- $metadata: deserializeMetadata(output),
1024
- };
1025
- break;
1026
- default:
1027
- const parsedBody = parsedOutput.body;
1028
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1029
- response = {
1030
- ...parsedBody,
1031
- name: `${errorCode}`,
1032
- message: parsedBody.message || parsedBody.Message || errorCode,
1033
- $fault: "client",
1034
- $metadata: deserializeMetadata(output),
1035
- } as any;
1036
- }
1037
- const message = response.message || response.Message || errorCode;
1038
- response.message = message;
1039
- delete response.Message;
1040
- return Promise.reject(Object.assign(new Error(message), response));
1041
- };
1042
-
1043
- export const deserializeAws_json1_1CreateHITTypeCommand = async (
1044
- output: __HttpResponse,
1045
- context: __SerdeContext
1046
- ): Promise<CreateHITTypeCommandOutput> => {
1047
- if (output.statusCode >= 300) {
1048
- return deserializeAws_json1_1CreateHITTypeCommandError(output, context);
1049
- }
1050
- const data: any = await parseBody(output.body, context);
1051
- let contents: any = {};
1052
- contents = deserializeAws_json1_1CreateHITTypeResponse(data, context);
1053
- const response: CreateHITTypeCommandOutput = {
1054
- $metadata: deserializeMetadata(output),
1055
- ...contents,
1056
- };
1057
- return Promise.resolve(response);
1058
- };
1059
-
1060
- const deserializeAws_json1_1CreateHITTypeCommandError = async (
1061
- output: __HttpResponse,
1062
- context: __SerdeContext
1063
- ): Promise<CreateHITTypeCommandOutput> => {
1064
- const parsedOutput: any = {
1065
- ...output,
1066
- body: await parseBody(output.body, context),
1067
- };
1068
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1069
- let errorCode = "UnknownError";
1070
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1071
- switch (errorCode) {
1072
- case "RequestError":
1073
- case "com.amazonaws.mturk#RequestError":
1074
- response = {
1075
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1076
- name: errorCode,
1077
- $metadata: deserializeMetadata(output),
1078
- };
1079
- break;
1080
- case "ServiceFault":
1081
- case "com.amazonaws.mturk#ServiceFault":
1082
- response = {
1083
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1084
- name: errorCode,
1085
- $metadata: deserializeMetadata(output),
1086
- };
1087
- break;
1088
- default:
1089
- const parsedBody = parsedOutput.body;
1090
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1091
- response = {
1092
- ...parsedBody,
1093
- name: `${errorCode}`,
1094
- message: parsedBody.message || parsedBody.Message || errorCode,
1095
- $fault: "client",
1096
- $metadata: deserializeMetadata(output),
1097
- } as any;
1098
- }
1099
- const message = response.message || response.Message || errorCode;
1100
- response.message = message;
1101
- delete response.Message;
1102
- return Promise.reject(Object.assign(new Error(message), response));
1103
- };
1104
-
1105
- export const deserializeAws_json1_1CreateHITWithHITTypeCommand = async (
1106
- output: __HttpResponse,
1107
- context: __SerdeContext
1108
- ): Promise<CreateHITWithHITTypeCommandOutput> => {
1109
- if (output.statusCode >= 300) {
1110
- return deserializeAws_json1_1CreateHITWithHITTypeCommandError(output, context);
1111
- }
1112
- const data: any = await parseBody(output.body, context);
1113
- let contents: any = {};
1114
- contents = deserializeAws_json1_1CreateHITWithHITTypeResponse(data, context);
1115
- const response: CreateHITWithHITTypeCommandOutput = {
1116
- $metadata: deserializeMetadata(output),
1117
- ...contents,
1118
- };
1119
- return Promise.resolve(response);
1120
- };
1121
-
1122
- const deserializeAws_json1_1CreateHITWithHITTypeCommandError = async (
1123
- output: __HttpResponse,
1124
- context: __SerdeContext
1125
- ): Promise<CreateHITWithHITTypeCommandOutput> => {
1126
- const parsedOutput: any = {
1127
- ...output,
1128
- body: await parseBody(output.body, context),
1129
- };
1130
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1131
- let errorCode = "UnknownError";
1132
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1133
- switch (errorCode) {
1134
- case "RequestError":
1135
- case "com.amazonaws.mturk#RequestError":
1136
- response = {
1137
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1138
- name: errorCode,
1139
- $metadata: deserializeMetadata(output),
1140
- };
1141
- break;
1142
- case "ServiceFault":
1143
- case "com.amazonaws.mturk#ServiceFault":
1144
- response = {
1145
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1146
- name: errorCode,
1147
- $metadata: deserializeMetadata(output),
1148
- };
1149
- break;
1150
- default:
1151
- const parsedBody = parsedOutput.body;
1152
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1153
- response = {
1154
- ...parsedBody,
1155
- name: `${errorCode}`,
1156
- message: parsedBody.message || parsedBody.Message || errorCode,
1157
- $fault: "client",
1158
- $metadata: deserializeMetadata(output),
1159
- } as any;
1160
- }
1161
- const message = response.message || response.Message || errorCode;
1162
- response.message = message;
1163
- delete response.Message;
1164
- return Promise.reject(Object.assign(new Error(message), response));
1165
- };
1166
-
1167
- export const deserializeAws_json1_1CreateQualificationTypeCommand = async (
1168
- output: __HttpResponse,
1169
- context: __SerdeContext
1170
- ): Promise<CreateQualificationTypeCommandOutput> => {
1171
- if (output.statusCode >= 300) {
1172
- return deserializeAws_json1_1CreateQualificationTypeCommandError(output, context);
1173
- }
1174
- const data: any = await parseBody(output.body, context);
1175
- let contents: any = {};
1176
- contents = deserializeAws_json1_1CreateQualificationTypeResponse(data, context);
1177
- const response: CreateQualificationTypeCommandOutput = {
1178
- $metadata: deserializeMetadata(output),
1179
- ...contents,
1180
- };
1181
- return Promise.resolve(response);
1182
- };
1183
-
1184
- const deserializeAws_json1_1CreateQualificationTypeCommandError = async (
1185
- output: __HttpResponse,
1186
- context: __SerdeContext
1187
- ): Promise<CreateQualificationTypeCommandOutput> => {
1188
- const parsedOutput: any = {
1189
- ...output,
1190
- body: await parseBody(output.body, context),
1191
- };
1192
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1193
- let errorCode = "UnknownError";
1194
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1195
- switch (errorCode) {
1196
- case "RequestError":
1197
- case "com.amazonaws.mturk#RequestError":
1198
- response = {
1199
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1200
- name: errorCode,
1201
- $metadata: deserializeMetadata(output),
1202
- };
1203
- break;
1204
- case "ServiceFault":
1205
- case "com.amazonaws.mturk#ServiceFault":
1206
- response = {
1207
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1208
- name: errorCode,
1209
- $metadata: deserializeMetadata(output),
1210
- };
1211
- break;
1212
- default:
1213
- const parsedBody = parsedOutput.body;
1214
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1215
- response = {
1216
- ...parsedBody,
1217
- name: `${errorCode}`,
1218
- message: parsedBody.message || parsedBody.Message || errorCode,
1219
- $fault: "client",
1220
- $metadata: deserializeMetadata(output),
1221
- } as any;
1222
- }
1223
- const message = response.message || response.Message || errorCode;
1224
- response.message = message;
1225
- delete response.Message;
1226
- return Promise.reject(Object.assign(new Error(message), response));
1227
- };
1228
-
1229
- export const deserializeAws_json1_1CreateWorkerBlockCommand = async (
1230
- output: __HttpResponse,
1231
- context: __SerdeContext
1232
- ): Promise<CreateWorkerBlockCommandOutput> => {
1233
- if (output.statusCode >= 300) {
1234
- return deserializeAws_json1_1CreateWorkerBlockCommandError(output, context);
1235
- }
1236
- const data: any = await parseBody(output.body, context);
1237
- let contents: any = {};
1238
- contents = deserializeAws_json1_1CreateWorkerBlockResponse(data, context);
1239
- const response: CreateWorkerBlockCommandOutput = {
1240
- $metadata: deserializeMetadata(output),
1241
- ...contents,
1242
- };
1243
- return Promise.resolve(response);
1244
- };
1245
-
1246
- const deserializeAws_json1_1CreateWorkerBlockCommandError = async (
1247
- output: __HttpResponse,
1248
- context: __SerdeContext
1249
- ): Promise<CreateWorkerBlockCommandOutput> => {
1250
- const parsedOutput: any = {
1251
- ...output,
1252
- body: await parseBody(output.body, context),
1253
- };
1254
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1255
- let errorCode = "UnknownError";
1256
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1257
- switch (errorCode) {
1258
- case "RequestError":
1259
- case "com.amazonaws.mturk#RequestError":
1260
- response = {
1261
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1262
- name: errorCode,
1263
- $metadata: deserializeMetadata(output),
1264
- };
1265
- break;
1266
- case "ServiceFault":
1267
- case "com.amazonaws.mturk#ServiceFault":
1268
- response = {
1269
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1270
- name: errorCode,
1271
- $metadata: deserializeMetadata(output),
1272
- };
1273
- break;
1274
- default:
1275
- const parsedBody = parsedOutput.body;
1276
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1277
- response = {
1278
- ...parsedBody,
1279
- name: `${errorCode}`,
1280
- message: parsedBody.message || parsedBody.Message || errorCode,
1281
- $fault: "client",
1282
- $metadata: deserializeMetadata(output),
1283
- } as any;
1284
- }
1285
- const message = response.message || response.Message || errorCode;
1286
- response.message = message;
1287
- delete response.Message;
1288
- return Promise.reject(Object.assign(new Error(message), response));
1289
- };
1290
-
1291
- export const deserializeAws_json1_1DeleteHITCommand = async (
1292
- output: __HttpResponse,
1293
- context: __SerdeContext
1294
- ): Promise<DeleteHITCommandOutput> => {
1295
- if (output.statusCode >= 300) {
1296
- return deserializeAws_json1_1DeleteHITCommandError(output, context);
1297
- }
1298
- const data: any = await parseBody(output.body, context);
1299
- let contents: any = {};
1300
- contents = deserializeAws_json1_1DeleteHITResponse(data, context);
1301
- const response: DeleteHITCommandOutput = {
1302
- $metadata: deserializeMetadata(output),
1303
- ...contents,
1304
- };
1305
- return Promise.resolve(response);
1306
- };
1307
-
1308
- const deserializeAws_json1_1DeleteHITCommandError = async (
1309
- output: __HttpResponse,
1310
- context: __SerdeContext
1311
- ): Promise<DeleteHITCommandOutput> => {
1312
- const parsedOutput: any = {
1313
- ...output,
1314
- body: await parseBody(output.body, context),
1315
- };
1316
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1317
- let errorCode = "UnknownError";
1318
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1319
- switch (errorCode) {
1320
- case "RequestError":
1321
- case "com.amazonaws.mturk#RequestError":
1322
- response = {
1323
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1324
- name: errorCode,
1325
- $metadata: deserializeMetadata(output),
1326
- };
1327
- break;
1328
- case "ServiceFault":
1329
- case "com.amazonaws.mturk#ServiceFault":
1330
- response = {
1331
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1332
- name: errorCode,
1333
- $metadata: deserializeMetadata(output),
1334
- };
1335
- break;
1336
- default:
1337
- const parsedBody = parsedOutput.body;
1338
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1339
- response = {
1340
- ...parsedBody,
1341
- name: `${errorCode}`,
1342
- message: parsedBody.message || parsedBody.Message || errorCode,
1343
- $fault: "client",
1344
- $metadata: deserializeMetadata(output),
1345
- } as any;
1346
- }
1347
- const message = response.message || response.Message || errorCode;
1348
- response.message = message;
1349
- delete response.Message;
1350
- return Promise.reject(Object.assign(new Error(message), response));
1351
- };
1352
-
1353
- export const deserializeAws_json1_1DeleteQualificationTypeCommand = async (
1354
- output: __HttpResponse,
1355
- context: __SerdeContext
1356
- ): Promise<DeleteQualificationTypeCommandOutput> => {
1357
- if (output.statusCode >= 300) {
1358
- return deserializeAws_json1_1DeleteQualificationTypeCommandError(output, context);
1359
- }
1360
- const data: any = await parseBody(output.body, context);
1361
- let contents: any = {};
1362
- contents = deserializeAws_json1_1DeleteQualificationTypeResponse(data, context);
1363
- const response: DeleteQualificationTypeCommandOutput = {
1364
- $metadata: deserializeMetadata(output),
1365
- ...contents,
1366
- };
1367
- return Promise.resolve(response);
1368
- };
1369
-
1370
- const deserializeAws_json1_1DeleteQualificationTypeCommandError = async (
1371
- output: __HttpResponse,
1372
- context: __SerdeContext
1373
- ): Promise<DeleteQualificationTypeCommandOutput> => {
1374
- const parsedOutput: any = {
1375
- ...output,
1376
- body: await parseBody(output.body, context),
1377
- };
1378
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1379
- let errorCode = "UnknownError";
1380
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1381
- switch (errorCode) {
1382
- case "RequestError":
1383
- case "com.amazonaws.mturk#RequestError":
1384
- response = {
1385
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1386
- name: errorCode,
1387
- $metadata: deserializeMetadata(output),
1388
- };
1389
- break;
1390
- case "ServiceFault":
1391
- case "com.amazonaws.mturk#ServiceFault":
1392
- response = {
1393
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1394
- name: errorCode,
1395
- $metadata: deserializeMetadata(output),
1396
- };
1397
- break;
1398
- default:
1399
- const parsedBody = parsedOutput.body;
1400
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1401
- response = {
1402
- ...parsedBody,
1403
- name: `${errorCode}`,
1404
- message: parsedBody.message || parsedBody.Message || errorCode,
1405
- $fault: "client",
1406
- $metadata: deserializeMetadata(output),
1407
- } as any;
1408
- }
1409
- const message = response.message || response.Message || errorCode;
1410
- response.message = message;
1411
- delete response.Message;
1412
- return Promise.reject(Object.assign(new Error(message), response));
1413
- };
1414
-
1415
- export const deserializeAws_json1_1DeleteWorkerBlockCommand = async (
1416
- output: __HttpResponse,
1417
- context: __SerdeContext
1418
- ): Promise<DeleteWorkerBlockCommandOutput> => {
1419
- if (output.statusCode >= 300) {
1420
- return deserializeAws_json1_1DeleteWorkerBlockCommandError(output, context);
1421
- }
1422
- const data: any = await parseBody(output.body, context);
1423
- let contents: any = {};
1424
- contents = deserializeAws_json1_1DeleteWorkerBlockResponse(data, context);
1425
- const response: DeleteWorkerBlockCommandOutput = {
1426
- $metadata: deserializeMetadata(output),
1427
- ...contents,
1428
- };
1429
- return Promise.resolve(response);
1430
- };
1431
-
1432
- const deserializeAws_json1_1DeleteWorkerBlockCommandError = async (
1433
- output: __HttpResponse,
1434
- context: __SerdeContext
1435
- ): Promise<DeleteWorkerBlockCommandOutput> => {
1436
- const parsedOutput: any = {
1437
- ...output,
1438
- body: await parseBody(output.body, context),
1439
- };
1440
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1441
- let errorCode = "UnknownError";
1442
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1443
- switch (errorCode) {
1444
- case "RequestError":
1445
- case "com.amazonaws.mturk#RequestError":
1446
- response = {
1447
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1448
- name: errorCode,
1449
- $metadata: deserializeMetadata(output),
1450
- };
1451
- break;
1452
- case "ServiceFault":
1453
- case "com.amazonaws.mturk#ServiceFault":
1454
- response = {
1455
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1456
- name: errorCode,
1457
- $metadata: deserializeMetadata(output),
1458
- };
1459
- break;
1460
- default:
1461
- const parsedBody = parsedOutput.body;
1462
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1463
- response = {
1464
- ...parsedBody,
1465
- name: `${errorCode}`,
1466
- message: parsedBody.message || parsedBody.Message || errorCode,
1467
- $fault: "client",
1468
- $metadata: deserializeMetadata(output),
1469
- } as any;
1470
- }
1471
- const message = response.message || response.Message || errorCode;
1472
- response.message = message;
1473
- delete response.Message;
1474
- return Promise.reject(Object.assign(new Error(message), response));
1475
- };
1476
-
1477
- export const deserializeAws_json1_1DisassociateQualificationFromWorkerCommand = async (
1478
- output: __HttpResponse,
1479
- context: __SerdeContext
1480
- ): Promise<DisassociateQualificationFromWorkerCommandOutput> => {
1481
- if (output.statusCode >= 300) {
1482
- return deserializeAws_json1_1DisassociateQualificationFromWorkerCommandError(output, context);
1483
- }
1484
- const data: any = await parseBody(output.body, context);
1485
- let contents: any = {};
1486
- contents = deserializeAws_json1_1DisassociateQualificationFromWorkerResponse(data, context);
1487
- const response: DisassociateQualificationFromWorkerCommandOutput = {
1488
- $metadata: deserializeMetadata(output),
1489
- ...contents,
1490
- };
1491
- return Promise.resolve(response);
1492
- };
1493
-
1494
- const deserializeAws_json1_1DisassociateQualificationFromWorkerCommandError = async (
1495
- output: __HttpResponse,
1496
- context: __SerdeContext
1497
- ): Promise<DisassociateQualificationFromWorkerCommandOutput> => {
1498
- const parsedOutput: any = {
1499
- ...output,
1500
- body: await parseBody(output.body, context),
1501
- };
1502
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1503
- let errorCode = "UnknownError";
1504
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1505
- switch (errorCode) {
1506
- case "RequestError":
1507
- case "com.amazonaws.mturk#RequestError":
1508
- response = {
1509
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1510
- name: errorCode,
1511
- $metadata: deserializeMetadata(output),
1512
- };
1513
- break;
1514
- case "ServiceFault":
1515
- case "com.amazonaws.mturk#ServiceFault":
1516
- response = {
1517
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1518
- name: errorCode,
1519
- $metadata: deserializeMetadata(output),
1520
- };
1521
- break;
1522
- default:
1523
- const parsedBody = parsedOutput.body;
1524
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1525
- response = {
1526
- ...parsedBody,
1527
- name: `${errorCode}`,
1528
- message: parsedBody.message || parsedBody.Message || errorCode,
1529
- $fault: "client",
1530
- $metadata: deserializeMetadata(output),
1531
- } as any;
1532
- }
1533
- const message = response.message || response.Message || errorCode;
1534
- response.message = message;
1535
- delete response.Message;
1536
- return Promise.reject(Object.assign(new Error(message), response));
1537
- };
1538
-
1539
- export const deserializeAws_json1_1GetAccountBalanceCommand = async (
1540
- output: __HttpResponse,
1541
- context: __SerdeContext
1542
- ): Promise<GetAccountBalanceCommandOutput> => {
1543
- if (output.statusCode >= 300) {
1544
- return deserializeAws_json1_1GetAccountBalanceCommandError(output, context);
1545
- }
1546
- const data: any = await parseBody(output.body, context);
1547
- let contents: any = {};
1548
- contents = deserializeAws_json1_1GetAccountBalanceResponse(data, context);
1549
- const response: GetAccountBalanceCommandOutput = {
1550
- $metadata: deserializeMetadata(output),
1551
- ...contents,
1552
- };
1553
- return Promise.resolve(response);
1554
- };
1555
-
1556
- const deserializeAws_json1_1GetAccountBalanceCommandError = async (
1557
- output: __HttpResponse,
1558
- context: __SerdeContext
1559
- ): Promise<GetAccountBalanceCommandOutput> => {
1560
- const parsedOutput: any = {
1561
- ...output,
1562
- body: await parseBody(output.body, context),
1563
- };
1564
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1565
- let errorCode = "UnknownError";
1566
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1567
- switch (errorCode) {
1568
- case "RequestError":
1569
- case "com.amazonaws.mturk#RequestError":
1570
- response = {
1571
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1572
- name: errorCode,
1573
- $metadata: deserializeMetadata(output),
1574
- };
1575
- break;
1576
- case "ServiceFault":
1577
- case "com.amazonaws.mturk#ServiceFault":
1578
- response = {
1579
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1580
- name: errorCode,
1581
- $metadata: deserializeMetadata(output),
1582
- };
1583
- break;
1584
- default:
1585
- const parsedBody = parsedOutput.body;
1586
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1587
- response = {
1588
- ...parsedBody,
1589
- name: `${errorCode}`,
1590
- message: parsedBody.message || parsedBody.Message || errorCode,
1591
- $fault: "client",
1592
- $metadata: deserializeMetadata(output),
1593
- } as any;
1594
- }
1595
- const message = response.message || response.Message || errorCode;
1596
- response.message = message;
1597
- delete response.Message;
1598
- return Promise.reject(Object.assign(new Error(message), response));
1599
- };
1600
-
1601
- export const deserializeAws_json1_1GetAssignmentCommand = async (
1602
- output: __HttpResponse,
1603
- context: __SerdeContext
1604
- ): Promise<GetAssignmentCommandOutput> => {
1605
- if (output.statusCode >= 300) {
1606
- return deserializeAws_json1_1GetAssignmentCommandError(output, context);
1607
- }
1608
- const data: any = await parseBody(output.body, context);
1609
- let contents: any = {};
1610
- contents = deserializeAws_json1_1GetAssignmentResponse(data, context);
1611
- const response: GetAssignmentCommandOutput = {
1612
- $metadata: deserializeMetadata(output),
1613
- ...contents,
1614
- };
1615
- return Promise.resolve(response);
1616
- };
1617
-
1618
- const deserializeAws_json1_1GetAssignmentCommandError = async (
1619
- output: __HttpResponse,
1620
- context: __SerdeContext
1621
- ): Promise<GetAssignmentCommandOutput> => {
1622
- const parsedOutput: any = {
1623
- ...output,
1624
- body: await parseBody(output.body, context),
1625
- };
1626
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1627
- let errorCode = "UnknownError";
1628
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1629
- switch (errorCode) {
1630
- case "RequestError":
1631
- case "com.amazonaws.mturk#RequestError":
1632
- response = {
1633
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1634
- name: errorCode,
1635
- $metadata: deserializeMetadata(output),
1636
- };
1637
- break;
1638
- case "ServiceFault":
1639
- case "com.amazonaws.mturk#ServiceFault":
1640
- response = {
1641
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1642
- name: errorCode,
1643
- $metadata: deserializeMetadata(output),
1644
- };
1645
- break;
1646
- default:
1647
- const parsedBody = parsedOutput.body;
1648
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1649
- response = {
1650
- ...parsedBody,
1651
- name: `${errorCode}`,
1652
- message: parsedBody.message || parsedBody.Message || errorCode,
1653
- $fault: "client",
1654
- $metadata: deserializeMetadata(output),
1655
- } as any;
1656
- }
1657
- const message = response.message || response.Message || errorCode;
1658
- response.message = message;
1659
- delete response.Message;
1660
- return Promise.reject(Object.assign(new Error(message), response));
1661
- };
1662
-
1663
- export const deserializeAws_json1_1GetFileUploadURLCommand = async (
1664
- output: __HttpResponse,
1665
- context: __SerdeContext
1666
- ): Promise<GetFileUploadURLCommandOutput> => {
1667
- if (output.statusCode >= 300) {
1668
- return deserializeAws_json1_1GetFileUploadURLCommandError(output, context);
1669
- }
1670
- const data: any = await parseBody(output.body, context);
1671
- let contents: any = {};
1672
- contents = deserializeAws_json1_1GetFileUploadURLResponse(data, context);
1673
- const response: GetFileUploadURLCommandOutput = {
1674
- $metadata: deserializeMetadata(output),
1675
- ...contents,
1676
- };
1677
- return Promise.resolve(response);
1678
- };
1679
-
1680
- const deserializeAws_json1_1GetFileUploadURLCommandError = async (
1681
- output: __HttpResponse,
1682
- context: __SerdeContext
1683
- ): Promise<GetFileUploadURLCommandOutput> => {
1684
- const parsedOutput: any = {
1685
- ...output,
1686
- body: await parseBody(output.body, context),
1687
- };
1688
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1689
- let errorCode = "UnknownError";
1690
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1691
- switch (errorCode) {
1692
- case "RequestError":
1693
- case "com.amazonaws.mturk#RequestError":
1694
- response = {
1695
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1696
- name: errorCode,
1697
- $metadata: deserializeMetadata(output),
1698
- };
1699
- break;
1700
- case "ServiceFault":
1701
- case "com.amazonaws.mturk#ServiceFault":
1702
- response = {
1703
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1704
- name: errorCode,
1705
- $metadata: deserializeMetadata(output),
1706
- };
1707
- break;
1708
- default:
1709
- const parsedBody = parsedOutput.body;
1710
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1711
- response = {
1712
- ...parsedBody,
1713
- name: `${errorCode}`,
1714
- message: parsedBody.message || parsedBody.Message || errorCode,
1715
- $fault: "client",
1716
- $metadata: deserializeMetadata(output),
1717
- } as any;
1718
- }
1719
- const message = response.message || response.Message || errorCode;
1720
- response.message = message;
1721
- delete response.Message;
1722
- return Promise.reject(Object.assign(new Error(message), response));
1723
- };
1724
-
1725
- export const deserializeAws_json1_1GetHITCommand = async (
1726
- output: __HttpResponse,
1727
- context: __SerdeContext
1728
- ): Promise<GetHITCommandOutput> => {
1729
- if (output.statusCode >= 300) {
1730
- return deserializeAws_json1_1GetHITCommandError(output, context);
1731
- }
1732
- const data: any = await parseBody(output.body, context);
1733
- let contents: any = {};
1734
- contents = deserializeAws_json1_1GetHITResponse(data, context);
1735
- const response: GetHITCommandOutput = {
1736
- $metadata: deserializeMetadata(output),
1737
- ...contents,
1738
- };
1739
- return Promise.resolve(response);
1740
- };
1741
-
1742
- const deserializeAws_json1_1GetHITCommandError = async (
1743
- output: __HttpResponse,
1744
- context: __SerdeContext
1745
- ): Promise<GetHITCommandOutput> => {
1746
- const parsedOutput: any = {
1747
- ...output,
1748
- body: await parseBody(output.body, context),
1749
- };
1750
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1751
- let errorCode = "UnknownError";
1752
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1753
- switch (errorCode) {
1754
- case "RequestError":
1755
- case "com.amazonaws.mturk#RequestError":
1756
- response = {
1757
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1758
- name: errorCode,
1759
- $metadata: deserializeMetadata(output),
1760
- };
1761
- break;
1762
- case "ServiceFault":
1763
- case "com.amazonaws.mturk#ServiceFault":
1764
- response = {
1765
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1766
- name: errorCode,
1767
- $metadata: deserializeMetadata(output),
1768
- };
1769
- break;
1770
- default:
1771
- const parsedBody = parsedOutput.body;
1772
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1773
- response = {
1774
- ...parsedBody,
1775
- name: `${errorCode}`,
1776
- message: parsedBody.message || parsedBody.Message || errorCode,
1777
- $fault: "client",
1778
- $metadata: deserializeMetadata(output),
1779
- } as any;
1780
- }
1781
- const message = response.message || response.Message || errorCode;
1782
- response.message = message;
1783
- delete response.Message;
1784
- return Promise.reject(Object.assign(new Error(message), response));
1785
- };
1786
-
1787
- export const deserializeAws_json1_1GetQualificationScoreCommand = async (
1788
- output: __HttpResponse,
1789
- context: __SerdeContext
1790
- ): Promise<GetQualificationScoreCommandOutput> => {
1791
- if (output.statusCode >= 300) {
1792
- return deserializeAws_json1_1GetQualificationScoreCommandError(output, context);
1793
- }
1794
- const data: any = await parseBody(output.body, context);
1795
- let contents: any = {};
1796
- contents = deserializeAws_json1_1GetQualificationScoreResponse(data, context);
1797
- const response: GetQualificationScoreCommandOutput = {
1798
- $metadata: deserializeMetadata(output),
1799
- ...contents,
1800
- };
1801
- return Promise.resolve(response);
1802
- };
1803
-
1804
- const deserializeAws_json1_1GetQualificationScoreCommandError = async (
1805
- output: __HttpResponse,
1806
- context: __SerdeContext
1807
- ): Promise<GetQualificationScoreCommandOutput> => {
1808
- const parsedOutput: any = {
1809
- ...output,
1810
- body: await parseBody(output.body, context),
1811
- };
1812
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1813
- let errorCode = "UnknownError";
1814
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1815
- switch (errorCode) {
1816
- case "RequestError":
1817
- case "com.amazonaws.mturk#RequestError":
1818
- response = {
1819
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1820
- name: errorCode,
1821
- $metadata: deserializeMetadata(output),
1822
- };
1823
- break;
1824
- case "ServiceFault":
1825
- case "com.amazonaws.mturk#ServiceFault":
1826
- response = {
1827
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1828
- name: errorCode,
1829
- $metadata: deserializeMetadata(output),
1830
- };
1831
- break;
1832
- default:
1833
- const parsedBody = parsedOutput.body;
1834
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1835
- response = {
1836
- ...parsedBody,
1837
- name: `${errorCode}`,
1838
- message: parsedBody.message || parsedBody.Message || errorCode,
1839
- $fault: "client",
1840
- $metadata: deserializeMetadata(output),
1841
- } as any;
1842
- }
1843
- const message = response.message || response.Message || errorCode;
1844
- response.message = message;
1845
- delete response.Message;
1846
- return Promise.reject(Object.assign(new Error(message), response));
1847
- };
1848
-
1849
- export const deserializeAws_json1_1GetQualificationTypeCommand = async (
1850
- output: __HttpResponse,
1851
- context: __SerdeContext
1852
- ): Promise<GetQualificationTypeCommandOutput> => {
1853
- if (output.statusCode >= 300) {
1854
- return deserializeAws_json1_1GetQualificationTypeCommandError(output, context);
1855
- }
1856
- const data: any = await parseBody(output.body, context);
1857
- let contents: any = {};
1858
- contents = deserializeAws_json1_1GetQualificationTypeResponse(data, context);
1859
- const response: GetQualificationTypeCommandOutput = {
1860
- $metadata: deserializeMetadata(output),
1861
- ...contents,
1862
- };
1863
- return Promise.resolve(response);
1864
- };
1865
-
1866
- const deserializeAws_json1_1GetQualificationTypeCommandError = async (
1867
- output: __HttpResponse,
1868
- context: __SerdeContext
1869
- ): Promise<GetQualificationTypeCommandOutput> => {
1870
- const parsedOutput: any = {
1871
- ...output,
1872
- body: await parseBody(output.body, context),
1873
- };
1874
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1875
- let errorCode = "UnknownError";
1876
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1877
- switch (errorCode) {
1878
- case "RequestError":
1879
- case "com.amazonaws.mturk#RequestError":
1880
- response = {
1881
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1882
- name: errorCode,
1883
- $metadata: deserializeMetadata(output),
1884
- };
1885
- break;
1886
- case "ServiceFault":
1887
- case "com.amazonaws.mturk#ServiceFault":
1888
- response = {
1889
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1890
- name: errorCode,
1891
- $metadata: deserializeMetadata(output),
1892
- };
1893
- break;
1894
- default:
1895
- const parsedBody = parsedOutput.body;
1896
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1897
- response = {
1898
- ...parsedBody,
1899
- name: `${errorCode}`,
1900
- message: parsedBody.message || parsedBody.Message || errorCode,
1901
- $fault: "client",
1902
- $metadata: deserializeMetadata(output),
1903
- } as any;
1904
- }
1905
- const message = response.message || response.Message || errorCode;
1906
- response.message = message;
1907
- delete response.Message;
1908
- return Promise.reject(Object.assign(new Error(message), response));
1909
- };
1910
-
1911
- export const deserializeAws_json1_1ListAssignmentsForHITCommand = async (
1912
- output: __HttpResponse,
1913
- context: __SerdeContext
1914
- ): Promise<ListAssignmentsForHITCommandOutput> => {
1915
- if (output.statusCode >= 300) {
1916
- return deserializeAws_json1_1ListAssignmentsForHITCommandError(output, context);
1917
- }
1918
- const data: any = await parseBody(output.body, context);
1919
- let contents: any = {};
1920
- contents = deserializeAws_json1_1ListAssignmentsForHITResponse(data, context);
1921
- const response: ListAssignmentsForHITCommandOutput = {
1922
- $metadata: deserializeMetadata(output),
1923
- ...contents,
1924
- };
1925
- return Promise.resolve(response);
1926
- };
1927
-
1928
- const deserializeAws_json1_1ListAssignmentsForHITCommandError = async (
1929
- output: __HttpResponse,
1930
- context: __SerdeContext
1931
- ): Promise<ListAssignmentsForHITCommandOutput> => {
1932
- const parsedOutput: any = {
1933
- ...output,
1934
- body: await parseBody(output.body, context),
1935
- };
1936
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1937
- let errorCode = "UnknownError";
1938
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1939
- switch (errorCode) {
1940
- case "RequestError":
1941
- case "com.amazonaws.mturk#RequestError":
1942
- response = {
1943
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
1944
- name: errorCode,
1945
- $metadata: deserializeMetadata(output),
1946
- };
1947
- break;
1948
- case "ServiceFault":
1949
- case "com.amazonaws.mturk#ServiceFault":
1950
- response = {
1951
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
1952
- name: errorCode,
1953
- $metadata: deserializeMetadata(output),
1954
- };
1955
- break;
1956
- default:
1957
- const parsedBody = parsedOutput.body;
1958
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1959
- response = {
1960
- ...parsedBody,
1961
- name: `${errorCode}`,
1962
- message: parsedBody.message || parsedBody.Message || errorCode,
1963
- $fault: "client",
1964
- $metadata: deserializeMetadata(output),
1965
- } as any;
1966
- }
1967
- const message = response.message || response.Message || errorCode;
1968
- response.message = message;
1969
- delete response.Message;
1970
- return Promise.reject(Object.assign(new Error(message), response));
1971
- };
1972
-
1973
- export const deserializeAws_json1_1ListBonusPaymentsCommand = async (
1974
- output: __HttpResponse,
1975
- context: __SerdeContext
1976
- ): Promise<ListBonusPaymentsCommandOutput> => {
1977
- if (output.statusCode >= 300) {
1978
- return deserializeAws_json1_1ListBonusPaymentsCommandError(output, context);
1979
- }
1980
- const data: any = await parseBody(output.body, context);
1981
- let contents: any = {};
1982
- contents = deserializeAws_json1_1ListBonusPaymentsResponse(data, context);
1983
- const response: ListBonusPaymentsCommandOutput = {
1984
- $metadata: deserializeMetadata(output),
1985
- ...contents,
1986
- };
1987
- return Promise.resolve(response);
1988
- };
1989
-
1990
- const deserializeAws_json1_1ListBonusPaymentsCommandError = async (
1991
- output: __HttpResponse,
1992
- context: __SerdeContext
1993
- ): Promise<ListBonusPaymentsCommandOutput> => {
1994
- const parsedOutput: any = {
1995
- ...output,
1996
- body: await parseBody(output.body, context),
1997
- };
1998
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1999
- let errorCode = "UnknownError";
2000
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2001
- switch (errorCode) {
2002
- case "RequestError":
2003
- case "com.amazonaws.mturk#RequestError":
2004
- response = {
2005
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2006
- name: errorCode,
2007
- $metadata: deserializeMetadata(output),
2008
- };
2009
- break;
2010
- case "ServiceFault":
2011
- case "com.amazonaws.mturk#ServiceFault":
2012
- response = {
2013
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2014
- name: errorCode,
2015
- $metadata: deserializeMetadata(output),
2016
- };
2017
- break;
2018
- default:
2019
- const parsedBody = parsedOutput.body;
2020
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2021
- response = {
2022
- ...parsedBody,
2023
- name: `${errorCode}`,
2024
- message: parsedBody.message || parsedBody.Message || errorCode,
2025
- $fault: "client",
2026
- $metadata: deserializeMetadata(output),
2027
- } as any;
2028
- }
2029
- const message = response.message || response.Message || errorCode;
2030
- response.message = message;
2031
- delete response.Message;
2032
- return Promise.reject(Object.assign(new Error(message), response));
2033
- };
2034
-
2035
- export const deserializeAws_json1_1ListHITsCommand = async (
2036
- output: __HttpResponse,
2037
- context: __SerdeContext
2038
- ): Promise<ListHITsCommandOutput> => {
2039
- if (output.statusCode >= 300) {
2040
- return deserializeAws_json1_1ListHITsCommandError(output, context);
2041
- }
2042
- const data: any = await parseBody(output.body, context);
2043
- let contents: any = {};
2044
- contents = deserializeAws_json1_1ListHITsResponse(data, context);
2045
- const response: ListHITsCommandOutput = {
2046
- $metadata: deserializeMetadata(output),
2047
- ...contents,
2048
- };
2049
- return Promise.resolve(response);
2050
- };
2051
-
2052
- const deserializeAws_json1_1ListHITsCommandError = async (
2053
- output: __HttpResponse,
2054
- context: __SerdeContext
2055
- ): Promise<ListHITsCommandOutput> => {
2056
- const parsedOutput: any = {
2057
- ...output,
2058
- body: await parseBody(output.body, context),
2059
- };
2060
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2061
- let errorCode = "UnknownError";
2062
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2063
- switch (errorCode) {
2064
- case "RequestError":
2065
- case "com.amazonaws.mturk#RequestError":
2066
- response = {
2067
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2068
- name: errorCode,
2069
- $metadata: deserializeMetadata(output),
2070
- };
2071
- break;
2072
- case "ServiceFault":
2073
- case "com.amazonaws.mturk#ServiceFault":
2074
- response = {
2075
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2076
- name: errorCode,
2077
- $metadata: deserializeMetadata(output),
2078
- };
2079
- break;
2080
- default:
2081
- const parsedBody = parsedOutput.body;
2082
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2083
- response = {
2084
- ...parsedBody,
2085
- name: `${errorCode}`,
2086
- message: parsedBody.message || parsedBody.Message || errorCode,
2087
- $fault: "client",
2088
- $metadata: deserializeMetadata(output),
2089
- } as any;
2090
- }
2091
- const message = response.message || response.Message || errorCode;
2092
- response.message = message;
2093
- delete response.Message;
2094
- return Promise.reject(Object.assign(new Error(message), response));
2095
- };
2096
-
2097
- export const deserializeAws_json1_1ListHITsForQualificationTypeCommand = async (
2098
- output: __HttpResponse,
2099
- context: __SerdeContext
2100
- ): Promise<ListHITsForQualificationTypeCommandOutput> => {
2101
- if (output.statusCode >= 300) {
2102
- return deserializeAws_json1_1ListHITsForQualificationTypeCommandError(output, context);
2103
- }
2104
- const data: any = await parseBody(output.body, context);
2105
- let contents: any = {};
2106
- contents = deserializeAws_json1_1ListHITsForQualificationTypeResponse(data, context);
2107
- const response: ListHITsForQualificationTypeCommandOutput = {
2108
- $metadata: deserializeMetadata(output),
2109
- ...contents,
2110
- };
2111
- return Promise.resolve(response);
2112
- };
2113
-
2114
- const deserializeAws_json1_1ListHITsForQualificationTypeCommandError = async (
2115
- output: __HttpResponse,
2116
- context: __SerdeContext
2117
- ): Promise<ListHITsForQualificationTypeCommandOutput> => {
2118
- const parsedOutput: any = {
2119
- ...output,
2120
- body: await parseBody(output.body, context),
2121
- };
2122
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2123
- let errorCode = "UnknownError";
2124
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2125
- switch (errorCode) {
2126
- case "RequestError":
2127
- case "com.amazonaws.mturk#RequestError":
2128
- response = {
2129
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2130
- name: errorCode,
2131
- $metadata: deserializeMetadata(output),
2132
- };
2133
- break;
2134
- case "ServiceFault":
2135
- case "com.amazonaws.mturk#ServiceFault":
2136
- response = {
2137
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2138
- name: errorCode,
2139
- $metadata: deserializeMetadata(output),
2140
- };
2141
- break;
2142
- default:
2143
- const parsedBody = parsedOutput.body;
2144
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2145
- response = {
2146
- ...parsedBody,
2147
- name: `${errorCode}`,
2148
- message: parsedBody.message || parsedBody.Message || errorCode,
2149
- $fault: "client",
2150
- $metadata: deserializeMetadata(output),
2151
- } as any;
2152
- }
2153
- const message = response.message || response.Message || errorCode;
2154
- response.message = message;
2155
- delete response.Message;
2156
- return Promise.reject(Object.assign(new Error(message), response));
2157
- };
2158
-
2159
- export const deserializeAws_json1_1ListQualificationRequestsCommand = async (
2160
- output: __HttpResponse,
2161
- context: __SerdeContext
2162
- ): Promise<ListQualificationRequestsCommandOutput> => {
2163
- if (output.statusCode >= 300) {
2164
- return deserializeAws_json1_1ListQualificationRequestsCommandError(output, context);
2165
- }
2166
- const data: any = await parseBody(output.body, context);
2167
- let contents: any = {};
2168
- contents = deserializeAws_json1_1ListQualificationRequestsResponse(data, context);
2169
- const response: ListQualificationRequestsCommandOutput = {
2170
- $metadata: deserializeMetadata(output),
2171
- ...contents,
2172
- };
2173
- return Promise.resolve(response);
2174
- };
2175
-
2176
- const deserializeAws_json1_1ListQualificationRequestsCommandError = async (
2177
- output: __HttpResponse,
2178
- context: __SerdeContext
2179
- ): Promise<ListQualificationRequestsCommandOutput> => {
2180
- const parsedOutput: any = {
2181
- ...output,
2182
- body: await parseBody(output.body, context),
2183
- };
2184
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2185
- let errorCode = "UnknownError";
2186
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2187
- switch (errorCode) {
2188
- case "RequestError":
2189
- case "com.amazonaws.mturk#RequestError":
2190
- response = {
2191
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2192
- name: errorCode,
2193
- $metadata: deserializeMetadata(output),
2194
- };
2195
- break;
2196
- case "ServiceFault":
2197
- case "com.amazonaws.mturk#ServiceFault":
2198
- response = {
2199
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2200
- name: errorCode,
2201
- $metadata: deserializeMetadata(output),
2202
- };
2203
- break;
2204
- default:
2205
- const parsedBody = parsedOutput.body;
2206
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2207
- response = {
2208
- ...parsedBody,
2209
- name: `${errorCode}`,
2210
- message: parsedBody.message || parsedBody.Message || errorCode,
2211
- $fault: "client",
2212
- $metadata: deserializeMetadata(output),
2213
- } as any;
2214
- }
2215
- const message = response.message || response.Message || errorCode;
2216
- response.message = message;
2217
- delete response.Message;
2218
- return Promise.reject(Object.assign(new Error(message), response));
2219
- };
2220
-
2221
- export const deserializeAws_json1_1ListQualificationTypesCommand = async (
2222
- output: __HttpResponse,
2223
- context: __SerdeContext
2224
- ): Promise<ListQualificationTypesCommandOutput> => {
2225
- if (output.statusCode >= 300) {
2226
- return deserializeAws_json1_1ListQualificationTypesCommandError(output, context);
2227
- }
2228
- const data: any = await parseBody(output.body, context);
2229
- let contents: any = {};
2230
- contents = deserializeAws_json1_1ListQualificationTypesResponse(data, context);
2231
- const response: ListQualificationTypesCommandOutput = {
2232
- $metadata: deserializeMetadata(output),
2233
- ...contents,
2234
- };
2235
- return Promise.resolve(response);
2236
- };
2237
-
2238
- const deserializeAws_json1_1ListQualificationTypesCommandError = async (
2239
- output: __HttpResponse,
2240
- context: __SerdeContext
2241
- ): Promise<ListQualificationTypesCommandOutput> => {
2242
- const parsedOutput: any = {
2243
- ...output,
2244
- body: await parseBody(output.body, context),
2245
- };
2246
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2247
- let errorCode = "UnknownError";
2248
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2249
- switch (errorCode) {
2250
- case "RequestError":
2251
- case "com.amazonaws.mturk#RequestError":
2252
- response = {
2253
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2254
- name: errorCode,
2255
- $metadata: deserializeMetadata(output),
2256
- };
2257
- break;
2258
- case "ServiceFault":
2259
- case "com.amazonaws.mturk#ServiceFault":
2260
- response = {
2261
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2262
- name: errorCode,
2263
- $metadata: deserializeMetadata(output),
2264
- };
2265
- break;
2266
- default:
2267
- const parsedBody = parsedOutput.body;
2268
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2269
- response = {
2270
- ...parsedBody,
2271
- name: `${errorCode}`,
2272
- message: parsedBody.message || parsedBody.Message || errorCode,
2273
- $fault: "client",
2274
- $metadata: deserializeMetadata(output),
2275
- } as any;
2276
- }
2277
- const message = response.message || response.Message || errorCode;
2278
- response.message = message;
2279
- delete response.Message;
2280
- return Promise.reject(Object.assign(new Error(message), response));
2281
- };
2282
-
2283
- export const deserializeAws_json1_1ListReviewableHITsCommand = async (
2284
- output: __HttpResponse,
2285
- context: __SerdeContext
2286
- ): Promise<ListReviewableHITsCommandOutput> => {
2287
- if (output.statusCode >= 300) {
2288
- return deserializeAws_json1_1ListReviewableHITsCommandError(output, context);
2289
- }
2290
- const data: any = await parseBody(output.body, context);
2291
- let contents: any = {};
2292
- contents = deserializeAws_json1_1ListReviewableHITsResponse(data, context);
2293
- const response: ListReviewableHITsCommandOutput = {
2294
- $metadata: deserializeMetadata(output),
2295
- ...contents,
2296
- };
2297
- return Promise.resolve(response);
2298
- };
2299
-
2300
- const deserializeAws_json1_1ListReviewableHITsCommandError = async (
2301
- output: __HttpResponse,
2302
- context: __SerdeContext
2303
- ): Promise<ListReviewableHITsCommandOutput> => {
2304
- const parsedOutput: any = {
2305
- ...output,
2306
- body: await parseBody(output.body, context),
2307
- };
2308
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2309
- let errorCode = "UnknownError";
2310
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2311
- switch (errorCode) {
2312
- case "RequestError":
2313
- case "com.amazonaws.mturk#RequestError":
2314
- response = {
2315
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2316
- name: errorCode,
2317
- $metadata: deserializeMetadata(output),
2318
- };
2319
- break;
2320
- case "ServiceFault":
2321
- case "com.amazonaws.mturk#ServiceFault":
2322
- response = {
2323
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2324
- name: errorCode,
2325
- $metadata: deserializeMetadata(output),
2326
- };
2327
- break;
2328
- default:
2329
- const parsedBody = parsedOutput.body;
2330
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2331
- response = {
2332
- ...parsedBody,
2333
- name: `${errorCode}`,
2334
- message: parsedBody.message || parsedBody.Message || errorCode,
2335
- $fault: "client",
2336
- $metadata: deserializeMetadata(output),
2337
- } as any;
2338
- }
2339
- const message = response.message || response.Message || errorCode;
2340
- response.message = message;
2341
- delete response.Message;
2342
- return Promise.reject(Object.assign(new Error(message), response));
2343
- };
2344
-
2345
- export const deserializeAws_json1_1ListReviewPolicyResultsForHITCommand = async (
2346
- output: __HttpResponse,
2347
- context: __SerdeContext
2348
- ): Promise<ListReviewPolicyResultsForHITCommandOutput> => {
2349
- if (output.statusCode >= 300) {
2350
- return deserializeAws_json1_1ListReviewPolicyResultsForHITCommandError(output, context);
2351
- }
2352
- const data: any = await parseBody(output.body, context);
2353
- let contents: any = {};
2354
- contents = deserializeAws_json1_1ListReviewPolicyResultsForHITResponse(data, context);
2355
- const response: ListReviewPolicyResultsForHITCommandOutput = {
2356
- $metadata: deserializeMetadata(output),
2357
- ...contents,
2358
- };
2359
- return Promise.resolve(response);
2360
- };
2361
-
2362
- const deserializeAws_json1_1ListReviewPolicyResultsForHITCommandError = async (
2363
- output: __HttpResponse,
2364
- context: __SerdeContext
2365
- ): Promise<ListReviewPolicyResultsForHITCommandOutput> => {
2366
- const parsedOutput: any = {
2367
- ...output,
2368
- body: await parseBody(output.body, context),
2369
- };
2370
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2371
- let errorCode = "UnknownError";
2372
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2373
- switch (errorCode) {
2374
- case "RequestError":
2375
- case "com.amazonaws.mturk#RequestError":
2376
- response = {
2377
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2378
- name: errorCode,
2379
- $metadata: deserializeMetadata(output),
2380
- };
2381
- break;
2382
- case "ServiceFault":
2383
- case "com.amazonaws.mturk#ServiceFault":
2384
- response = {
2385
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2386
- name: errorCode,
2387
- $metadata: deserializeMetadata(output),
2388
- };
2389
- break;
2390
- default:
2391
- const parsedBody = parsedOutput.body;
2392
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2393
- response = {
2394
- ...parsedBody,
2395
- name: `${errorCode}`,
2396
- message: parsedBody.message || parsedBody.Message || errorCode,
2397
- $fault: "client",
2398
- $metadata: deserializeMetadata(output),
2399
- } as any;
2400
- }
2401
- const message = response.message || response.Message || errorCode;
2402
- response.message = message;
2403
- delete response.Message;
2404
- return Promise.reject(Object.assign(new Error(message), response));
2405
- };
2406
-
2407
- export const deserializeAws_json1_1ListWorkerBlocksCommand = async (
2408
- output: __HttpResponse,
2409
- context: __SerdeContext
2410
- ): Promise<ListWorkerBlocksCommandOutput> => {
2411
- if (output.statusCode >= 300) {
2412
- return deserializeAws_json1_1ListWorkerBlocksCommandError(output, context);
2413
- }
2414
- const data: any = await parseBody(output.body, context);
2415
- let contents: any = {};
2416
- contents = deserializeAws_json1_1ListWorkerBlocksResponse(data, context);
2417
- const response: ListWorkerBlocksCommandOutput = {
2418
- $metadata: deserializeMetadata(output),
2419
- ...contents,
2420
- };
2421
- return Promise.resolve(response);
2422
- };
2423
-
2424
- const deserializeAws_json1_1ListWorkerBlocksCommandError = async (
2425
- output: __HttpResponse,
2426
- context: __SerdeContext
2427
- ): Promise<ListWorkerBlocksCommandOutput> => {
2428
- const parsedOutput: any = {
2429
- ...output,
2430
- body: await parseBody(output.body, context),
2431
- };
2432
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2433
- let errorCode = "UnknownError";
2434
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2435
- switch (errorCode) {
2436
- case "RequestError":
2437
- case "com.amazonaws.mturk#RequestError":
2438
- response = {
2439
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2440
- name: errorCode,
2441
- $metadata: deserializeMetadata(output),
2442
- };
2443
- break;
2444
- case "ServiceFault":
2445
- case "com.amazonaws.mturk#ServiceFault":
2446
- response = {
2447
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2448
- name: errorCode,
2449
- $metadata: deserializeMetadata(output),
2450
- };
2451
- break;
2452
- default:
2453
- const parsedBody = parsedOutput.body;
2454
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2455
- response = {
2456
- ...parsedBody,
2457
- name: `${errorCode}`,
2458
- message: parsedBody.message || parsedBody.Message || errorCode,
2459
- $fault: "client",
2460
- $metadata: deserializeMetadata(output),
2461
- } as any;
2462
- }
2463
- const message = response.message || response.Message || errorCode;
2464
- response.message = message;
2465
- delete response.Message;
2466
- return Promise.reject(Object.assign(new Error(message), response));
2467
- };
2468
-
2469
- export const deserializeAws_json1_1ListWorkersWithQualificationTypeCommand = async (
2470
- output: __HttpResponse,
2471
- context: __SerdeContext
2472
- ): Promise<ListWorkersWithQualificationTypeCommandOutput> => {
2473
- if (output.statusCode >= 300) {
2474
- return deserializeAws_json1_1ListWorkersWithQualificationTypeCommandError(output, context);
2475
- }
2476
- const data: any = await parseBody(output.body, context);
2477
- let contents: any = {};
2478
- contents = deserializeAws_json1_1ListWorkersWithQualificationTypeResponse(data, context);
2479
- const response: ListWorkersWithQualificationTypeCommandOutput = {
2480
- $metadata: deserializeMetadata(output),
2481
- ...contents,
2482
- };
2483
- return Promise.resolve(response);
2484
- };
2485
-
2486
- const deserializeAws_json1_1ListWorkersWithQualificationTypeCommandError = async (
2487
- output: __HttpResponse,
2488
- context: __SerdeContext
2489
- ): Promise<ListWorkersWithQualificationTypeCommandOutput> => {
2490
- const parsedOutput: any = {
2491
- ...output,
2492
- body: await parseBody(output.body, context),
2493
- };
2494
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2495
- let errorCode = "UnknownError";
2496
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2497
- switch (errorCode) {
2498
- case "RequestError":
2499
- case "com.amazonaws.mturk#RequestError":
2500
- response = {
2501
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2502
- name: errorCode,
2503
- $metadata: deserializeMetadata(output),
2504
- };
2505
- break;
2506
- case "ServiceFault":
2507
- case "com.amazonaws.mturk#ServiceFault":
2508
- response = {
2509
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2510
- name: errorCode,
2511
- $metadata: deserializeMetadata(output),
2512
- };
2513
- break;
2514
- default:
2515
- const parsedBody = parsedOutput.body;
2516
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2517
- response = {
2518
- ...parsedBody,
2519
- name: `${errorCode}`,
2520
- message: parsedBody.message || parsedBody.Message || errorCode,
2521
- $fault: "client",
2522
- $metadata: deserializeMetadata(output),
2523
- } as any;
2524
- }
2525
- const message = response.message || response.Message || errorCode;
2526
- response.message = message;
2527
- delete response.Message;
2528
- return Promise.reject(Object.assign(new Error(message), response));
2529
- };
2530
-
2531
- export const deserializeAws_json1_1NotifyWorkersCommand = async (
2532
- output: __HttpResponse,
2533
- context: __SerdeContext
2534
- ): Promise<NotifyWorkersCommandOutput> => {
2535
- if (output.statusCode >= 300) {
2536
- return deserializeAws_json1_1NotifyWorkersCommandError(output, context);
2537
- }
2538
- const data: any = await parseBody(output.body, context);
2539
- let contents: any = {};
2540
- contents = deserializeAws_json1_1NotifyWorkersResponse(data, context);
2541
- const response: NotifyWorkersCommandOutput = {
2542
- $metadata: deserializeMetadata(output),
2543
- ...contents,
2544
- };
2545
- return Promise.resolve(response);
2546
- };
2547
-
2548
- const deserializeAws_json1_1NotifyWorkersCommandError = async (
2549
- output: __HttpResponse,
2550
- context: __SerdeContext
2551
- ): Promise<NotifyWorkersCommandOutput> => {
2552
- const parsedOutput: any = {
2553
- ...output,
2554
- body: await parseBody(output.body, context),
2555
- };
2556
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2557
- let errorCode = "UnknownError";
2558
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2559
- switch (errorCode) {
2560
- case "RequestError":
2561
- case "com.amazonaws.mturk#RequestError":
2562
- response = {
2563
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2564
- name: errorCode,
2565
- $metadata: deserializeMetadata(output),
2566
- };
2567
- break;
2568
- case "ServiceFault":
2569
- case "com.amazonaws.mturk#ServiceFault":
2570
- response = {
2571
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2572
- name: errorCode,
2573
- $metadata: deserializeMetadata(output),
2574
- };
2575
- break;
2576
- default:
2577
- const parsedBody = parsedOutput.body;
2578
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2579
- response = {
2580
- ...parsedBody,
2581
- name: `${errorCode}`,
2582
- message: parsedBody.message || parsedBody.Message || errorCode,
2583
- $fault: "client",
2584
- $metadata: deserializeMetadata(output),
2585
- } as any;
2586
- }
2587
- const message = response.message || response.Message || errorCode;
2588
- response.message = message;
2589
- delete response.Message;
2590
- return Promise.reject(Object.assign(new Error(message), response));
2591
- };
2592
-
2593
- export const deserializeAws_json1_1RejectAssignmentCommand = async (
2594
- output: __HttpResponse,
2595
- context: __SerdeContext
2596
- ): Promise<RejectAssignmentCommandOutput> => {
2597
- if (output.statusCode >= 300) {
2598
- return deserializeAws_json1_1RejectAssignmentCommandError(output, context);
2599
- }
2600
- const data: any = await parseBody(output.body, context);
2601
- let contents: any = {};
2602
- contents = deserializeAws_json1_1RejectAssignmentResponse(data, context);
2603
- const response: RejectAssignmentCommandOutput = {
2604
- $metadata: deserializeMetadata(output),
2605
- ...contents,
2606
- };
2607
- return Promise.resolve(response);
2608
- };
2609
-
2610
- const deserializeAws_json1_1RejectAssignmentCommandError = async (
2611
- output: __HttpResponse,
2612
- context: __SerdeContext
2613
- ): Promise<RejectAssignmentCommandOutput> => {
2614
- const parsedOutput: any = {
2615
- ...output,
2616
- body: await parseBody(output.body, context),
2617
- };
2618
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2619
- let errorCode = "UnknownError";
2620
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2621
- switch (errorCode) {
2622
- case "RequestError":
2623
- case "com.amazonaws.mturk#RequestError":
2624
- response = {
2625
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2626
- name: errorCode,
2627
- $metadata: deserializeMetadata(output),
2628
- };
2629
- break;
2630
- case "ServiceFault":
2631
- case "com.amazonaws.mturk#ServiceFault":
2632
- response = {
2633
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2634
- name: errorCode,
2635
- $metadata: deserializeMetadata(output),
2636
- };
2637
- break;
2638
- default:
2639
- const parsedBody = parsedOutput.body;
2640
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2641
- response = {
2642
- ...parsedBody,
2643
- name: `${errorCode}`,
2644
- message: parsedBody.message || parsedBody.Message || errorCode,
2645
- $fault: "client",
2646
- $metadata: deserializeMetadata(output),
2647
- } as any;
2648
- }
2649
- const message = response.message || response.Message || errorCode;
2650
- response.message = message;
2651
- delete response.Message;
2652
- return Promise.reject(Object.assign(new Error(message), response));
2653
- };
2654
-
2655
- export const deserializeAws_json1_1RejectQualificationRequestCommand = async (
2656
- output: __HttpResponse,
2657
- context: __SerdeContext
2658
- ): Promise<RejectQualificationRequestCommandOutput> => {
2659
- if (output.statusCode >= 300) {
2660
- return deserializeAws_json1_1RejectQualificationRequestCommandError(output, context);
2661
- }
2662
- const data: any = await parseBody(output.body, context);
2663
- let contents: any = {};
2664
- contents = deserializeAws_json1_1RejectQualificationRequestResponse(data, context);
2665
- const response: RejectQualificationRequestCommandOutput = {
2666
- $metadata: deserializeMetadata(output),
2667
- ...contents,
2668
- };
2669
- return Promise.resolve(response);
2670
- };
2671
-
2672
- const deserializeAws_json1_1RejectQualificationRequestCommandError = async (
2673
- output: __HttpResponse,
2674
- context: __SerdeContext
2675
- ): Promise<RejectQualificationRequestCommandOutput> => {
2676
- const parsedOutput: any = {
2677
- ...output,
2678
- body: await parseBody(output.body, context),
2679
- };
2680
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2681
- let errorCode = "UnknownError";
2682
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2683
- switch (errorCode) {
2684
- case "RequestError":
2685
- case "com.amazonaws.mturk#RequestError":
2686
- response = {
2687
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2688
- name: errorCode,
2689
- $metadata: deserializeMetadata(output),
2690
- };
2691
- break;
2692
- case "ServiceFault":
2693
- case "com.amazonaws.mturk#ServiceFault":
2694
- response = {
2695
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2696
- name: errorCode,
2697
- $metadata: deserializeMetadata(output),
2698
- };
2699
- break;
2700
- default:
2701
- const parsedBody = parsedOutput.body;
2702
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2703
- response = {
2704
- ...parsedBody,
2705
- name: `${errorCode}`,
2706
- message: parsedBody.message || parsedBody.Message || errorCode,
2707
- $fault: "client",
2708
- $metadata: deserializeMetadata(output),
2709
- } as any;
2710
- }
2711
- const message = response.message || response.Message || errorCode;
2712
- response.message = message;
2713
- delete response.Message;
2714
- return Promise.reject(Object.assign(new Error(message), response));
2715
- };
2716
-
2717
- export const deserializeAws_json1_1SendBonusCommand = async (
2718
- output: __HttpResponse,
2719
- context: __SerdeContext
2720
- ): Promise<SendBonusCommandOutput> => {
2721
- if (output.statusCode >= 300) {
2722
- return deserializeAws_json1_1SendBonusCommandError(output, context);
2723
- }
2724
- const data: any = await parseBody(output.body, context);
2725
- let contents: any = {};
2726
- contents = deserializeAws_json1_1SendBonusResponse(data, context);
2727
- const response: SendBonusCommandOutput = {
2728
- $metadata: deserializeMetadata(output),
2729
- ...contents,
2730
- };
2731
- return Promise.resolve(response);
2732
- };
2733
-
2734
- const deserializeAws_json1_1SendBonusCommandError = async (
2735
- output: __HttpResponse,
2736
- context: __SerdeContext
2737
- ): Promise<SendBonusCommandOutput> => {
2738
- const parsedOutput: any = {
2739
- ...output,
2740
- body: await parseBody(output.body, context),
2741
- };
2742
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2743
- let errorCode = "UnknownError";
2744
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2745
- switch (errorCode) {
2746
- case "RequestError":
2747
- case "com.amazonaws.mturk#RequestError":
2748
- response = {
2749
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2750
- name: errorCode,
2751
- $metadata: deserializeMetadata(output),
2752
- };
2753
- break;
2754
- case "ServiceFault":
2755
- case "com.amazonaws.mturk#ServiceFault":
2756
- response = {
2757
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2758
- name: errorCode,
2759
- $metadata: deserializeMetadata(output),
2760
- };
2761
- break;
2762
- default:
2763
- const parsedBody = parsedOutput.body;
2764
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2765
- response = {
2766
- ...parsedBody,
2767
- name: `${errorCode}`,
2768
- message: parsedBody.message || parsedBody.Message || errorCode,
2769
- $fault: "client",
2770
- $metadata: deserializeMetadata(output),
2771
- } as any;
2772
- }
2773
- const message = response.message || response.Message || errorCode;
2774
- response.message = message;
2775
- delete response.Message;
2776
- return Promise.reject(Object.assign(new Error(message), response));
2777
- };
2778
-
2779
- export const deserializeAws_json1_1SendTestEventNotificationCommand = async (
2780
- output: __HttpResponse,
2781
- context: __SerdeContext
2782
- ): Promise<SendTestEventNotificationCommandOutput> => {
2783
- if (output.statusCode >= 300) {
2784
- return deserializeAws_json1_1SendTestEventNotificationCommandError(output, context);
2785
- }
2786
- const data: any = await parseBody(output.body, context);
2787
- let contents: any = {};
2788
- contents = deserializeAws_json1_1SendTestEventNotificationResponse(data, context);
2789
- const response: SendTestEventNotificationCommandOutput = {
2790
- $metadata: deserializeMetadata(output),
2791
- ...contents,
2792
- };
2793
- return Promise.resolve(response);
2794
- };
2795
-
2796
- const deserializeAws_json1_1SendTestEventNotificationCommandError = async (
2797
- output: __HttpResponse,
2798
- context: __SerdeContext
2799
- ): Promise<SendTestEventNotificationCommandOutput> => {
2800
- const parsedOutput: any = {
2801
- ...output,
2802
- body: await parseBody(output.body, context),
2803
- };
2804
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2805
- let errorCode = "UnknownError";
2806
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2807
- switch (errorCode) {
2808
- case "RequestError":
2809
- case "com.amazonaws.mturk#RequestError":
2810
- response = {
2811
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2812
- name: errorCode,
2813
- $metadata: deserializeMetadata(output),
2814
- };
2815
- break;
2816
- case "ServiceFault":
2817
- case "com.amazonaws.mturk#ServiceFault":
2818
- response = {
2819
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2820
- name: errorCode,
2821
- $metadata: deserializeMetadata(output),
2822
- };
2823
- break;
2824
- default:
2825
- const parsedBody = parsedOutput.body;
2826
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2827
- response = {
2828
- ...parsedBody,
2829
- name: `${errorCode}`,
2830
- message: parsedBody.message || parsedBody.Message || errorCode,
2831
- $fault: "client",
2832
- $metadata: deserializeMetadata(output),
2833
- } as any;
2834
- }
2835
- const message = response.message || response.Message || errorCode;
2836
- response.message = message;
2837
- delete response.Message;
2838
- return Promise.reject(Object.assign(new Error(message), response));
2839
- };
2840
-
2841
- export const deserializeAws_json1_1UpdateExpirationForHITCommand = async (
2842
- output: __HttpResponse,
2843
- context: __SerdeContext
2844
- ): Promise<UpdateExpirationForHITCommandOutput> => {
2845
- if (output.statusCode >= 300) {
2846
- return deserializeAws_json1_1UpdateExpirationForHITCommandError(output, context);
2847
- }
2848
- const data: any = await parseBody(output.body, context);
2849
- let contents: any = {};
2850
- contents = deserializeAws_json1_1UpdateExpirationForHITResponse(data, context);
2851
- const response: UpdateExpirationForHITCommandOutput = {
2852
- $metadata: deserializeMetadata(output),
2853
- ...contents,
2854
- };
2855
- return Promise.resolve(response);
2856
- };
2857
-
2858
- const deserializeAws_json1_1UpdateExpirationForHITCommandError = async (
2859
- output: __HttpResponse,
2860
- context: __SerdeContext
2861
- ): Promise<UpdateExpirationForHITCommandOutput> => {
2862
- const parsedOutput: any = {
2863
- ...output,
2864
- body: await parseBody(output.body, context),
2865
- };
2866
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2867
- let errorCode = "UnknownError";
2868
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2869
- switch (errorCode) {
2870
- case "RequestError":
2871
- case "com.amazonaws.mturk#RequestError":
2872
- response = {
2873
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2874
- name: errorCode,
2875
- $metadata: deserializeMetadata(output),
2876
- };
2877
- break;
2878
- case "ServiceFault":
2879
- case "com.amazonaws.mturk#ServiceFault":
2880
- response = {
2881
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2882
- name: errorCode,
2883
- $metadata: deserializeMetadata(output),
2884
- };
2885
- break;
2886
- default:
2887
- const parsedBody = parsedOutput.body;
2888
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2889
- response = {
2890
- ...parsedBody,
2891
- name: `${errorCode}`,
2892
- message: parsedBody.message || parsedBody.Message || errorCode,
2893
- $fault: "client",
2894
- $metadata: deserializeMetadata(output),
2895
- } as any;
2896
- }
2897
- const message = response.message || response.Message || errorCode;
2898
- response.message = message;
2899
- delete response.Message;
2900
- return Promise.reject(Object.assign(new Error(message), response));
2901
- };
2902
-
2903
- export const deserializeAws_json1_1UpdateHITReviewStatusCommand = async (
2904
- output: __HttpResponse,
2905
- context: __SerdeContext
2906
- ): Promise<UpdateHITReviewStatusCommandOutput> => {
2907
- if (output.statusCode >= 300) {
2908
- return deserializeAws_json1_1UpdateHITReviewStatusCommandError(output, context);
2909
- }
2910
- const data: any = await parseBody(output.body, context);
2911
- let contents: any = {};
2912
- contents = deserializeAws_json1_1UpdateHITReviewStatusResponse(data, context);
2913
- const response: UpdateHITReviewStatusCommandOutput = {
2914
- $metadata: deserializeMetadata(output),
2915
- ...contents,
2916
- };
2917
- return Promise.resolve(response);
2918
- };
2919
-
2920
- const deserializeAws_json1_1UpdateHITReviewStatusCommandError = async (
2921
- output: __HttpResponse,
2922
- context: __SerdeContext
2923
- ): Promise<UpdateHITReviewStatusCommandOutput> => {
2924
- const parsedOutput: any = {
2925
- ...output,
2926
- body: await parseBody(output.body, context),
2927
- };
2928
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2929
- let errorCode = "UnknownError";
2930
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2931
- switch (errorCode) {
2932
- case "RequestError":
2933
- case "com.amazonaws.mturk#RequestError":
2934
- response = {
2935
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2936
- name: errorCode,
2937
- $metadata: deserializeMetadata(output),
2938
- };
2939
- break;
2940
- case "ServiceFault":
2941
- case "com.amazonaws.mturk#ServiceFault":
2942
- response = {
2943
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
2944
- name: errorCode,
2945
- $metadata: deserializeMetadata(output),
2946
- };
2947
- break;
2948
- default:
2949
- const parsedBody = parsedOutput.body;
2950
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2951
- response = {
2952
- ...parsedBody,
2953
- name: `${errorCode}`,
2954
- message: parsedBody.message || parsedBody.Message || errorCode,
2955
- $fault: "client",
2956
- $metadata: deserializeMetadata(output),
2957
- } as any;
2958
- }
2959
- const message = response.message || response.Message || errorCode;
2960
- response.message = message;
2961
- delete response.Message;
2962
- return Promise.reject(Object.assign(new Error(message), response));
2963
- };
2964
-
2965
- export const deserializeAws_json1_1UpdateHITTypeOfHITCommand = async (
2966
- output: __HttpResponse,
2967
- context: __SerdeContext
2968
- ): Promise<UpdateHITTypeOfHITCommandOutput> => {
2969
- if (output.statusCode >= 300) {
2970
- return deserializeAws_json1_1UpdateHITTypeOfHITCommandError(output, context);
2971
- }
2972
- const data: any = await parseBody(output.body, context);
2973
- let contents: any = {};
2974
- contents = deserializeAws_json1_1UpdateHITTypeOfHITResponse(data, context);
2975
- const response: UpdateHITTypeOfHITCommandOutput = {
2976
- $metadata: deserializeMetadata(output),
2977
- ...contents,
2978
- };
2979
- return Promise.resolve(response);
2980
- };
2981
-
2982
- const deserializeAws_json1_1UpdateHITTypeOfHITCommandError = async (
2983
- output: __HttpResponse,
2984
- context: __SerdeContext
2985
- ): Promise<UpdateHITTypeOfHITCommandOutput> => {
2986
- const parsedOutput: any = {
2987
- ...output,
2988
- body: await parseBody(output.body, context),
2989
- };
2990
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2991
- let errorCode = "UnknownError";
2992
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2993
- switch (errorCode) {
2994
- case "RequestError":
2995
- case "com.amazonaws.mturk#RequestError":
2996
- response = {
2997
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
2998
- name: errorCode,
2999
- $metadata: deserializeMetadata(output),
3000
- };
3001
- break;
3002
- case "ServiceFault":
3003
- case "com.amazonaws.mturk#ServiceFault":
3004
- response = {
3005
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
3006
- name: errorCode,
3007
- $metadata: deserializeMetadata(output),
3008
- };
3009
- break;
3010
- default:
3011
- const parsedBody = parsedOutput.body;
3012
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3013
- response = {
3014
- ...parsedBody,
3015
- name: `${errorCode}`,
3016
- message: parsedBody.message || parsedBody.Message || errorCode,
3017
- $fault: "client",
3018
- $metadata: deserializeMetadata(output),
3019
- } as any;
3020
- }
3021
- const message = response.message || response.Message || errorCode;
3022
- response.message = message;
3023
- delete response.Message;
3024
- return Promise.reject(Object.assign(new Error(message), response));
3025
- };
3026
-
3027
- export const deserializeAws_json1_1UpdateNotificationSettingsCommand = async (
3028
- output: __HttpResponse,
3029
- context: __SerdeContext
3030
- ): Promise<UpdateNotificationSettingsCommandOutput> => {
3031
- if (output.statusCode >= 300) {
3032
- return deserializeAws_json1_1UpdateNotificationSettingsCommandError(output, context);
3033
- }
3034
- const data: any = await parseBody(output.body, context);
3035
- let contents: any = {};
3036
- contents = deserializeAws_json1_1UpdateNotificationSettingsResponse(data, context);
3037
- const response: UpdateNotificationSettingsCommandOutput = {
3038
- $metadata: deserializeMetadata(output),
3039
- ...contents,
3040
- };
3041
- return Promise.resolve(response);
3042
- };
3043
-
3044
- const deserializeAws_json1_1UpdateNotificationSettingsCommandError = async (
3045
- output: __HttpResponse,
3046
- context: __SerdeContext
3047
- ): Promise<UpdateNotificationSettingsCommandOutput> => {
3048
- const parsedOutput: any = {
3049
- ...output,
3050
- body: await parseBody(output.body, context),
3051
- };
3052
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
3053
- let errorCode = "UnknownError";
3054
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3055
- switch (errorCode) {
3056
- case "RequestError":
3057
- case "com.amazonaws.mturk#RequestError":
3058
- response = {
3059
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
3060
- name: errorCode,
3061
- $metadata: deserializeMetadata(output),
3062
- };
3063
- break;
3064
- case "ServiceFault":
3065
- case "com.amazonaws.mturk#ServiceFault":
3066
- response = {
3067
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
3068
- name: errorCode,
3069
- $metadata: deserializeMetadata(output),
3070
- };
3071
- break;
3072
- default:
3073
- const parsedBody = parsedOutput.body;
3074
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3075
- response = {
3076
- ...parsedBody,
3077
- name: `${errorCode}`,
3078
- message: parsedBody.message || parsedBody.Message || errorCode,
3079
- $fault: "client",
3080
- $metadata: deserializeMetadata(output),
3081
- } as any;
3082
- }
3083
- const message = response.message || response.Message || errorCode;
3084
- response.message = message;
3085
- delete response.Message;
3086
- return Promise.reject(Object.assign(new Error(message), response));
3087
- };
3088
-
3089
- export const deserializeAws_json1_1UpdateQualificationTypeCommand = async (
3090
- output: __HttpResponse,
3091
- context: __SerdeContext
3092
- ): Promise<UpdateQualificationTypeCommandOutput> => {
3093
- if (output.statusCode >= 300) {
3094
- return deserializeAws_json1_1UpdateQualificationTypeCommandError(output, context);
3095
- }
3096
- const data: any = await parseBody(output.body, context);
3097
- let contents: any = {};
3098
- contents = deserializeAws_json1_1UpdateQualificationTypeResponse(data, context);
3099
- const response: UpdateQualificationTypeCommandOutput = {
3100
- $metadata: deserializeMetadata(output),
3101
- ...contents,
3102
- };
3103
- return Promise.resolve(response);
3104
- };
3105
-
3106
- const deserializeAws_json1_1UpdateQualificationTypeCommandError = async (
3107
- output: __HttpResponse,
3108
- context: __SerdeContext
3109
- ): Promise<UpdateQualificationTypeCommandOutput> => {
3110
- const parsedOutput: any = {
3111
- ...output,
3112
- body: await parseBody(output.body, context),
3113
- };
3114
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
3115
- let errorCode = "UnknownError";
3116
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3117
- switch (errorCode) {
3118
- case "RequestError":
3119
- case "com.amazonaws.mturk#RequestError":
3120
- response = {
3121
- ...(await deserializeAws_json1_1RequestErrorResponse(parsedOutput, context)),
3122
- name: errorCode,
3123
- $metadata: deserializeMetadata(output),
3124
- };
3125
- break;
3126
- case "ServiceFault":
3127
- case "com.amazonaws.mturk#ServiceFault":
3128
- response = {
3129
- ...(await deserializeAws_json1_1ServiceFaultResponse(parsedOutput, context)),
3130
- name: errorCode,
3131
- $metadata: deserializeMetadata(output),
3132
- };
3133
- break;
3134
- default:
3135
- const parsedBody = parsedOutput.body;
3136
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3137
- response = {
3138
- ...parsedBody,
3139
- name: `${errorCode}`,
3140
- message: parsedBody.message || parsedBody.Message || errorCode,
3141
- $fault: "client",
3142
- $metadata: deserializeMetadata(output),
3143
- } as any;
3144
- }
3145
- const message = response.message || response.Message || errorCode;
3146
- response.message = message;
3147
- delete response.Message;
3148
- return Promise.reject(Object.assign(new Error(message), response));
3149
- };
3150
-
3151
- const deserializeAws_json1_1RequestErrorResponse = async (
3152
- parsedOutput: any,
3153
- context: __SerdeContext
3154
- ): Promise<RequestError> => {
3155
- const body = parsedOutput.body;
3156
- const deserialized: any = deserializeAws_json1_1RequestError(body, context);
3157
- const contents: RequestError = {
3158
- name: "RequestError",
3159
- $fault: "client",
3160
- $metadata: deserializeMetadata(parsedOutput),
3161
- ...deserialized,
3162
- };
3163
- return contents;
3164
- };
3165
-
3166
- const deserializeAws_json1_1ServiceFaultResponse = async (
3167
- parsedOutput: any,
3168
- context: __SerdeContext
3169
- ): Promise<ServiceFault> => {
3170
- const body = parsedOutput.body;
3171
- const deserialized: any = deserializeAws_json1_1ServiceFault(body, context);
3172
- const contents: ServiceFault = {
3173
- name: "ServiceFault",
3174
- $fault: "server",
3175
- $metadata: deserializeMetadata(parsedOutput),
3176
- ...deserialized,
3177
- };
3178
- return contents;
3179
- };
3180
-
3181
- const serializeAws_json1_1AcceptQualificationRequestRequest = (
3182
- input: AcceptQualificationRequestRequest,
3183
- context: __SerdeContext
3184
- ): any => {
3185
- return {
3186
- ...(input.IntegerValue !== undefined && input.IntegerValue !== null && { IntegerValue: input.IntegerValue }),
3187
- ...(input.QualificationRequestId !== undefined &&
3188
- input.QualificationRequestId !== null && { QualificationRequestId: input.QualificationRequestId }),
3189
- };
3190
- };
3191
-
3192
- const serializeAws_json1_1ApproveAssignmentRequest = (
3193
- input: ApproveAssignmentRequest,
3194
- context: __SerdeContext
3195
- ): any => {
3196
- return {
3197
- ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }),
3198
- ...(input.OverrideRejection !== undefined &&
3199
- input.OverrideRejection !== null && { OverrideRejection: input.OverrideRejection }),
3200
- ...(input.RequesterFeedback !== undefined &&
3201
- input.RequesterFeedback !== null && { RequesterFeedback: input.RequesterFeedback }),
3202
- };
3203
- };
3204
-
3205
- const serializeAws_json1_1AssignmentStatusList = (
3206
- input: (AssignmentStatus | string)[],
3207
- context: __SerdeContext
3208
- ): any => {
3209
- return input
3210
- .filter((e: any) => e != null)
3211
- .map((entry) => {
3212
- if (entry === null) {
3213
- return null as any;
3214
- }
3215
- return entry;
3216
- });
3217
- };
3218
-
3219
- const serializeAws_json1_1AssociateQualificationWithWorkerRequest = (
3220
- input: AssociateQualificationWithWorkerRequest,
3221
- context: __SerdeContext
3222
- ): any => {
3223
- return {
3224
- ...(input.IntegerValue !== undefined && input.IntegerValue !== null && { IntegerValue: input.IntegerValue }),
3225
- ...(input.QualificationTypeId !== undefined &&
3226
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3227
- ...(input.SendNotification !== undefined &&
3228
- input.SendNotification !== null && { SendNotification: input.SendNotification }),
3229
- ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }),
3230
- };
3231
- };
3232
-
3233
- const serializeAws_json1_1CreateAdditionalAssignmentsForHITRequest = (
3234
- input: CreateAdditionalAssignmentsForHITRequest,
3235
- context: __SerdeContext
3236
- ): any => {
3237
- return {
3238
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3239
- ...(input.NumberOfAdditionalAssignments !== undefined &&
3240
- input.NumberOfAdditionalAssignments !== null && {
3241
- NumberOfAdditionalAssignments: input.NumberOfAdditionalAssignments,
3242
- }),
3243
- ...(input.UniqueRequestToken !== undefined &&
3244
- input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }),
3245
- };
3246
- };
3247
-
3248
- const serializeAws_json1_1CreateHITRequest = (input: CreateHITRequest, context: __SerdeContext): any => {
3249
- return {
3250
- ...(input.AssignmentDurationInSeconds !== undefined &&
3251
- input.AssignmentDurationInSeconds !== null && { AssignmentDurationInSeconds: input.AssignmentDurationInSeconds }),
3252
- ...(input.AssignmentReviewPolicy !== undefined &&
3253
- input.AssignmentReviewPolicy !== null && {
3254
- AssignmentReviewPolicy: serializeAws_json1_1ReviewPolicy(input.AssignmentReviewPolicy, context),
3255
- }),
3256
- ...(input.AutoApprovalDelayInSeconds !== undefined &&
3257
- input.AutoApprovalDelayInSeconds !== null && { AutoApprovalDelayInSeconds: input.AutoApprovalDelayInSeconds }),
3258
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
3259
- ...(input.HITLayoutId !== undefined && input.HITLayoutId !== null && { HITLayoutId: input.HITLayoutId }),
3260
- ...(input.HITLayoutParameters !== undefined &&
3261
- input.HITLayoutParameters !== null && {
3262
- HITLayoutParameters: serializeAws_json1_1HITLayoutParameterList(input.HITLayoutParameters, context),
3263
- }),
3264
- ...(input.HITReviewPolicy !== undefined &&
3265
- input.HITReviewPolicy !== null && {
3266
- HITReviewPolicy: serializeAws_json1_1ReviewPolicy(input.HITReviewPolicy, context),
3267
- }),
3268
- ...(input.Keywords !== undefined && input.Keywords !== null && { Keywords: input.Keywords }),
3269
- ...(input.LifetimeInSeconds !== undefined &&
3270
- input.LifetimeInSeconds !== null && { LifetimeInSeconds: input.LifetimeInSeconds }),
3271
- ...(input.MaxAssignments !== undefined &&
3272
- input.MaxAssignments !== null && { MaxAssignments: input.MaxAssignments }),
3273
- ...(input.QualificationRequirements !== undefined &&
3274
- input.QualificationRequirements !== null && {
3275
- QualificationRequirements: serializeAws_json1_1QualificationRequirementList(
3276
- input.QualificationRequirements,
3277
- context
3278
- ),
3279
- }),
3280
- ...(input.Question !== undefined && input.Question !== null && { Question: input.Question }),
3281
- ...(input.RequesterAnnotation !== undefined &&
3282
- input.RequesterAnnotation !== null && { RequesterAnnotation: input.RequesterAnnotation }),
3283
- ...(input.Reward !== undefined && input.Reward !== null && { Reward: input.Reward }),
3284
- ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }),
3285
- ...(input.UniqueRequestToken !== undefined &&
3286
- input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }),
3287
- };
3288
- };
3289
-
3290
- const serializeAws_json1_1CreateHITTypeRequest = (input: CreateHITTypeRequest, context: __SerdeContext): any => {
3291
- return {
3292
- ...(input.AssignmentDurationInSeconds !== undefined &&
3293
- input.AssignmentDurationInSeconds !== null && { AssignmentDurationInSeconds: input.AssignmentDurationInSeconds }),
3294
- ...(input.AutoApprovalDelayInSeconds !== undefined &&
3295
- input.AutoApprovalDelayInSeconds !== null && { AutoApprovalDelayInSeconds: input.AutoApprovalDelayInSeconds }),
3296
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
3297
- ...(input.Keywords !== undefined && input.Keywords !== null && { Keywords: input.Keywords }),
3298
- ...(input.QualificationRequirements !== undefined &&
3299
- input.QualificationRequirements !== null && {
3300
- QualificationRequirements: serializeAws_json1_1QualificationRequirementList(
3301
- input.QualificationRequirements,
3302
- context
3303
- ),
3304
- }),
3305
- ...(input.Reward !== undefined && input.Reward !== null && { Reward: input.Reward }),
3306
- ...(input.Title !== undefined && input.Title !== null && { Title: input.Title }),
3307
- };
3308
- };
3309
-
3310
- const serializeAws_json1_1CreateHITWithHITTypeRequest = (
3311
- input: CreateHITWithHITTypeRequest,
3312
- context: __SerdeContext
3313
- ): any => {
3314
- return {
3315
- ...(input.AssignmentReviewPolicy !== undefined &&
3316
- input.AssignmentReviewPolicy !== null && {
3317
- AssignmentReviewPolicy: serializeAws_json1_1ReviewPolicy(input.AssignmentReviewPolicy, context),
3318
- }),
3319
- ...(input.HITLayoutId !== undefined && input.HITLayoutId !== null && { HITLayoutId: input.HITLayoutId }),
3320
- ...(input.HITLayoutParameters !== undefined &&
3321
- input.HITLayoutParameters !== null && {
3322
- HITLayoutParameters: serializeAws_json1_1HITLayoutParameterList(input.HITLayoutParameters, context),
3323
- }),
3324
- ...(input.HITReviewPolicy !== undefined &&
3325
- input.HITReviewPolicy !== null && {
3326
- HITReviewPolicy: serializeAws_json1_1ReviewPolicy(input.HITReviewPolicy, context),
3327
- }),
3328
- ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }),
3329
- ...(input.LifetimeInSeconds !== undefined &&
3330
- input.LifetimeInSeconds !== null && { LifetimeInSeconds: input.LifetimeInSeconds }),
3331
- ...(input.MaxAssignments !== undefined &&
3332
- input.MaxAssignments !== null && { MaxAssignments: input.MaxAssignments }),
3333
- ...(input.Question !== undefined && input.Question !== null && { Question: input.Question }),
3334
- ...(input.RequesterAnnotation !== undefined &&
3335
- input.RequesterAnnotation !== null && { RequesterAnnotation: input.RequesterAnnotation }),
3336
- ...(input.UniqueRequestToken !== undefined &&
3337
- input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }),
3338
- };
3339
- };
3340
-
3341
- const serializeAws_json1_1CreateQualificationTypeRequest = (
3342
- input: CreateQualificationTypeRequest,
3343
- context: __SerdeContext
3344
- ): any => {
3345
- return {
3346
- ...(input.AnswerKey !== undefined && input.AnswerKey !== null && { AnswerKey: input.AnswerKey }),
3347
- ...(input.AutoGranted !== undefined && input.AutoGranted !== null && { AutoGranted: input.AutoGranted }),
3348
- ...(input.AutoGrantedValue !== undefined &&
3349
- input.AutoGrantedValue !== null && { AutoGrantedValue: input.AutoGrantedValue }),
3350
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
3351
- ...(input.Keywords !== undefined && input.Keywords !== null && { Keywords: input.Keywords }),
3352
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
3353
- ...(input.QualificationTypeStatus !== undefined &&
3354
- input.QualificationTypeStatus !== null && { QualificationTypeStatus: input.QualificationTypeStatus }),
3355
- ...(input.RetryDelayInSeconds !== undefined &&
3356
- input.RetryDelayInSeconds !== null && { RetryDelayInSeconds: input.RetryDelayInSeconds }),
3357
- ...(input.Test !== undefined && input.Test !== null && { Test: input.Test }),
3358
- ...(input.TestDurationInSeconds !== undefined &&
3359
- input.TestDurationInSeconds !== null && { TestDurationInSeconds: input.TestDurationInSeconds }),
3360
- };
3361
- };
3362
-
3363
- const serializeAws_json1_1CreateWorkerBlockRequest = (
3364
- input: CreateWorkerBlockRequest,
3365
- context: __SerdeContext
3366
- ): any => {
3367
- return {
3368
- ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }),
3369
- ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }),
3370
- };
3371
- };
3372
-
3373
- const serializeAws_json1_1CustomerIdList = (input: string[], context: __SerdeContext): any => {
3374
- return input
3375
- .filter((e: any) => e != null)
3376
- .map((entry) => {
3377
- if (entry === null) {
3378
- return null as any;
3379
- }
3380
- return entry;
3381
- });
3382
- };
3383
-
3384
- const serializeAws_json1_1DeleteHITRequest = (input: DeleteHITRequest, context: __SerdeContext): any => {
3385
- return {
3386
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3387
- };
3388
- };
3389
-
3390
- const serializeAws_json1_1DeleteQualificationTypeRequest = (
3391
- input: DeleteQualificationTypeRequest,
3392
- context: __SerdeContext
3393
- ): any => {
3394
- return {
3395
- ...(input.QualificationTypeId !== undefined &&
3396
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3397
- };
3398
- };
3399
-
3400
- const serializeAws_json1_1DeleteWorkerBlockRequest = (
3401
- input: DeleteWorkerBlockRequest,
3402
- context: __SerdeContext
3403
- ): any => {
3404
- return {
3405
- ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }),
3406
- ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }),
3407
- };
3408
- };
3409
-
3410
- const serializeAws_json1_1DisassociateQualificationFromWorkerRequest = (
3411
- input: DisassociateQualificationFromWorkerRequest,
3412
- context: __SerdeContext
3413
- ): any => {
3414
- return {
3415
- ...(input.QualificationTypeId !== undefined &&
3416
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3417
- ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }),
3418
- ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }),
3419
- };
3420
- };
3421
-
3422
- const serializeAws_json1_1EventTypeList = (input: (EventType | string)[], context: __SerdeContext): any => {
3423
- return input
3424
- .filter((e: any) => e != null)
3425
- .map((entry) => {
3426
- if (entry === null) {
3427
- return null as any;
3428
- }
3429
- return entry;
3430
- });
3431
- };
3432
-
3433
- const serializeAws_json1_1GetAccountBalanceRequest = (
3434
- input: GetAccountBalanceRequest,
3435
- context: __SerdeContext
3436
- ): any => {
3437
- return {};
3438
- };
3439
-
3440
- const serializeAws_json1_1GetAssignmentRequest = (input: GetAssignmentRequest, context: __SerdeContext): any => {
3441
- return {
3442
- ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }),
3443
- };
3444
- };
3445
-
3446
- const serializeAws_json1_1GetFileUploadURLRequest = (input: GetFileUploadURLRequest, context: __SerdeContext): any => {
3447
- return {
3448
- ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }),
3449
- ...(input.QuestionIdentifier !== undefined &&
3450
- input.QuestionIdentifier !== null && { QuestionIdentifier: input.QuestionIdentifier }),
3451
- };
3452
- };
3453
-
3454
- const serializeAws_json1_1GetHITRequest = (input: GetHITRequest, context: __SerdeContext): any => {
3455
- return {
3456
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3457
- };
3458
- };
3459
-
3460
- const serializeAws_json1_1GetQualificationScoreRequest = (
3461
- input: GetQualificationScoreRequest,
3462
- context: __SerdeContext
3463
- ): any => {
3464
- return {
3465
- ...(input.QualificationTypeId !== undefined &&
3466
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3467
- ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }),
3468
- };
3469
- };
3470
-
3471
- const serializeAws_json1_1GetQualificationTypeRequest = (
3472
- input: GetQualificationTypeRequest,
3473
- context: __SerdeContext
3474
- ): any => {
3475
- return {
3476
- ...(input.QualificationTypeId !== undefined &&
3477
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3478
- };
3479
- };
3480
-
3481
- const serializeAws_json1_1HITLayoutParameter = (input: HITLayoutParameter, context: __SerdeContext): any => {
3482
- return {
3483
- ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }),
3484
- ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),
3485
- };
3486
- };
3487
-
3488
- const serializeAws_json1_1HITLayoutParameterList = (input: HITLayoutParameter[], context: __SerdeContext): any => {
3489
- return input
3490
- .filter((e: any) => e != null)
3491
- .map((entry) => {
3492
- if (entry === null) {
3493
- return null as any;
3494
- }
3495
- return serializeAws_json1_1HITLayoutParameter(entry, context);
3496
- });
3497
- };
3498
-
3499
- const serializeAws_json1_1IntegerList = (input: number[], context: __SerdeContext): any => {
3500
- return input
3501
- .filter((e: any) => e != null)
3502
- .map((entry) => {
3503
- if (entry === null) {
3504
- return null as any;
3505
- }
3506
- return entry;
3507
- });
3508
- };
3509
-
3510
- const serializeAws_json1_1ListAssignmentsForHITRequest = (
3511
- input: ListAssignmentsForHITRequest,
3512
- context: __SerdeContext
3513
- ): any => {
3514
- return {
3515
- ...(input.AssignmentStatuses !== undefined &&
3516
- input.AssignmentStatuses !== null && {
3517
- AssignmentStatuses: serializeAws_json1_1AssignmentStatusList(input.AssignmentStatuses, context),
3518
- }),
3519
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3520
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3521
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3522
- };
3523
- };
3524
-
3525
- const serializeAws_json1_1ListBonusPaymentsRequest = (
3526
- input: ListBonusPaymentsRequest,
3527
- context: __SerdeContext
3528
- ): any => {
3529
- return {
3530
- ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }),
3531
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3532
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3533
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3534
- };
3535
- };
3536
-
3537
- const serializeAws_json1_1ListHITsForQualificationTypeRequest = (
3538
- input: ListHITsForQualificationTypeRequest,
3539
- context: __SerdeContext
3540
- ): any => {
3541
- return {
3542
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3543
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3544
- ...(input.QualificationTypeId !== undefined &&
3545
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3546
- };
3547
- };
3548
-
3549
- const serializeAws_json1_1ListHITsRequest = (input: ListHITsRequest, context: __SerdeContext): any => {
3550
- return {
3551
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3552
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3553
- };
3554
- };
3555
-
3556
- const serializeAws_json1_1ListQualificationRequestsRequest = (
3557
- input: ListQualificationRequestsRequest,
3558
- context: __SerdeContext
3559
- ): any => {
3560
- return {
3561
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3562
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3563
- ...(input.QualificationTypeId !== undefined &&
3564
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3565
- };
3566
- };
3567
-
3568
- const serializeAws_json1_1ListQualificationTypesRequest = (
3569
- input: ListQualificationTypesRequest,
3570
- context: __SerdeContext
3571
- ): any => {
3572
- return {
3573
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3574
- ...(input.MustBeOwnedByCaller !== undefined &&
3575
- input.MustBeOwnedByCaller !== null && { MustBeOwnedByCaller: input.MustBeOwnedByCaller }),
3576
- ...(input.MustBeRequestable !== undefined &&
3577
- input.MustBeRequestable !== null && { MustBeRequestable: input.MustBeRequestable }),
3578
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3579
- ...(input.Query !== undefined && input.Query !== null && { Query: input.Query }),
3580
- };
3581
- };
3582
-
3583
- const serializeAws_json1_1ListReviewableHITsRequest = (
3584
- input: ListReviewableHITsRequest,
3585
- context: __SerdeContext
3586
- ): any => {
3587
- return {
3588
- ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }),
3589
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3590
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3591
- ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }),
3592
- };
3593
- };
3594
-
3595
- const serializeAws_json1_1ListReviewPolicyResultsForHITRequest = (
3596
- input: ListReviewPolicyResultsForHITRequest,
3597
- context: __SerdeContext
3598
- ): any => {
3599
- return {
3600
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3601
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3602
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3603
- ...(input.PolicyLevels !== undefined &&
3604
- input.PolicyLevels !== null && {
3605
- PolicyLevels: serializeAws_json1_1ReviewPolicyLevelList(input.PolicyLevels, context),
3606
- }),
3607
- ...(input.RetrieveActions !== undefined &&
3608
- input.RetrieveActions !== null && { RetrieveActions: input.RetrieveActions }),
3609
- ...(input.RetrieveResults !== undefined &&
3610
- input.RetrieveResults !== null && { RetrieveResults: input.RetrieveResults }),
3611
- };
3612
- };
3613
-
3614
- const serializeAws_json1_1ListWorkerBlocksRequest = (input: ListWorkerBlocksRequest, context: __SerdeContext): any => {
3615
- return {
3616
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3617
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3618
- };
3619
- };
3620
-
3621
- const serializeAws_json1_1ListWorkersWithQualificationTypeRequest = (
3622
- input: ListWorkersWithQualificationTypeRequest,
3623
- context: __SerdeContext
3624
- ): any => {
3625
- return {
3626
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
3627
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
3628
- ...(input.QualificationTypeId !== undefined &&
3629
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3630
- ...(input.Status !== undefined && input.Status !== null && { Status: input.Status }),
3631
- };
3632
- };
3633
-
3634
- const serializeAws_json1_1Locale = (input: Locale, context: __SerdeContext): any => {
3635
- return {
3636
- ...(input.Country !== undefined && input.Country !== null && { Country: input.Country }),
3637
- ...(input.Subdivision !== undefined && input.Subdivision !== null && { Subdivision: input.Subdivision }),
3638
- };
3639
- };
3640
-
3641
- const serializeAws_json1_1LocaleList = (input: Locale[], context: __SerdeContext): any => {
3642
- return input
3643
- .filter((e: any) => e != null)
3644
- .map((entry) => {
3645
- if (entry === null) {
3646
- return null as any;
3647
- }
3648
- return serializeAws_json1_1Locale(entry, context);
3649
- });
3650
- };
3651
-
3652
- const serializeAws_json1_1NotificationSpecification = (
3653
- input: NotificationSpecification,
3654
- context: __SerdeContext
3655
- ): any => {
3656
- return {
3657
- ...(input.Destination !== undefined && input.Destination !== null && { Destination: input.Destination }),
3658
- ...(input.EventTypes !== undefined &&
3659
- input.EventTypes !== null && { EventTypes: serializeAws_json1_1EventTypeList(input.EventTypes, context) }),
3660
- ...(input.Transport !== undefined && input.Transport !== null && { Transport: input.Transport }),
3661
- ...(input.Version !== undefined && input.Version !== null && { Version: input.Version }),
3662
- };
3663
- };
3664
-
3665
- const serializeAws_json1_1NotifyWorkersRequest = (input: NotifyWorkersRequest, context: __SerdeContext): any => {
3666
- return {
3667
- ...(input.MessageText !== undefined && input.MessageText !== null && { MessageText: input.MessageText }),
3668
- ...(input.Subject !== undefined && input.Subject !== null && { Subject: input.Subject }),
3669
- ...(input.WorkerIds !== undefined &&
3670
- input.WorkerIds !== null && { WorkerIds: serializeAws_json1_1CustomerIdList(input.WorkerIds, context) }),
3671
- };
3672
- };
3673
-
3674
- const serializeAws_json1_1ParameterMapEntry = (input: ParameterMapEntry, context: __SerdeContext): any => {
3675
- return {
3676
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
3677
- ...(input.Values !== undefined &&
3678
- input.Values !== null && { Values: serializeAws_json1_1StringList(input.Values, context) }),
3679
- };
3680
- };
3681
-
3682
- const serializeAws_json1_1ParameterMapEntryList = (input: ParameterMapEntry[], context: __SerdeContext): any => {
3683
- return input
3684
- .filter((e: any) => e != null)
3685
- .map((entry) => {
3686
- if (entry === null) {
3687
- return null as any;
3688
- }
3689
- return serializeAws_json1_1ParameterMapEntry(entry, context);
3690
- });
3691
- };
3692
-
3693
- const serializeAws_json1_1PolicyParameter = (input: PolicyParameter, context: __SerdeContext): any => {
3694
- return {
3695
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
3696
- ...(input.MapEntries !== undefined &&
3697
- input.MapEntries !== null && {
3698
- MapEntries: serializeAws_json1_1ParameterMapEntryList(input.MapEntries, context),
3699
- }),
3700
- ...(input.Values !== undefined &&
3701
- input.Values !== null && { Values: serializeAws_json1_1StringList(input.Values, context) }),
3702
- };
3703
- };
3704
-
3705
- const serializeAws_json1_1PolicyParameterList = (input: PolicyParameter[], context: __SerdeContext): any => {
3706
- return input
3707
- .filter((e: any) => e != null)
3708
- .map((entry) => {
3709
- if (entry === null) {
3710
- return null as any;
3711
- }
3712
- return serializeAws_json1_1PolicyParameter(entry, context);
3713
- });
3714
- };
3715
-
3716
- const serializeAws_json1_1QualificationRequirement = (
3717
- input: QualificationRequirement,
3718
- context: __SerdeContext
3719
- ): any => {
3720
- return {
3721
- ...(input.ActionsGuarded !== undefined &&
3722
- input.ActionsGuarded !== null && { ActionsGuarded: input.ActionsGuarded }),
3723
- ...(input.Comparator !== undefined && input.Comparator !== null && { Comparator: input.Comparator }),
3724
- ...(input.IntegerValues !== undefined &&
3725
- input.IntegerValues !== null && { IntegerValues: serializeAws_json1_1IntegerList(input.IntegerValues, context) }),
3726
- ...(input.LocaleValues !== undefined &&
3727
- input.LocaleValues !== null && { LocaleValues: serializeAws_json1_1LocaleList(input.LocaleValues, context) }),
3728
- ...(input.QualificationTypeId !== undefined &&
3729
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3730
- ...(input.RequiredToPreview !== undefined &&
3731
- input.RequiredToPreview !== null && { RequiredToPreview: input.RequiredToPreview }),
3732
- };
3733
- };
3734
-
3735
- const serializeAws_json1_1QualificationRequirementList = (
3736
- input: QualificationRequirement[],
3737
- context: __SerdeContext
3738
- ): any => {
3739
- return input
3740
- .filter((e: any) => e != null)
3741
- .map((entry) => {
3742
- if (entry === null) {
3743
- return null as any;
3744
- }
3745
- return serializeAws_json1_1QualificationRequirement(entry, context);
3746
- });
3747
- };
3748
-
3749
- const serializeAws_json1_1RejectAssignmentRequest = (input: RejectAssignmentRequest, context: __SerdeContext): any => {
3750
- return {
3751
- ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }),
3752
- ...(input.RequesterFeedback !== undefined &&
3753
- input.RequesterFeedback !== null && { RequesterFeedback: input.RequesterFeedback }),
3754
- };
3755
- };
3756
-
3757
- const serializeAws_json1_1RejectQualificationRequestRequest = (
3758
- input: RejectQualificationRequestRequest,
3759
- context: __SerdeContext
3760
- ): any => {
3761
- return {
3762
- ...(input.QualificationRequestId !== undefined &&
3763
- input.QualificationRequestId !== null && { QualificationRequestId: input.QualificationRequestId }),
3764
- ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }),
3765
- };
3766
- };
3767
-
3768
- const serializeAws_json1_1ReviewPolicy = (input: ReviewPolicy, context: __SerdeContext): any => {
3769
- return {
3770
- ...(input.Parameters !== undefined &&
3771
- input.Parameters !== null && { Parameters: serializeAws_json1_1PolicyParameterList(input.Parameters, context) }),
3772
- ...(input.PolicyName !== undefined && input.PolicyName !== null && { PolicyName: input.PolicyName }),
3773
- };
3774
- };
3775
-
3776
- const serializeAws_json1_1ReviewPolicyLevelList = (
3777
- input: (ReviewPolicyLevel | string)[],
3778
- context: __SerdeContext
3779
- ): any => {
3780
- return input
3781
- .filter((e: any) => e != null)
3782
- .map((entry) => {
3783
- if (entry === null) {
3784
- return null as any;
3785
- }
3786
- return entry;
3787
- });
3788
- };
3789
-
3790
- const serializeAws_json1_1SendBonusRequest = (input: SendBonusRequest, context: __SerdeContext): any => {
3791
- return {
3792
- ...(input.AssignmentId !== undefined && input.AssignmentId !== null && { AssignmentId: input.AssignmentId }),
3793
- ...(input.BonusAmount !== undefined && input.BonusAmount !== null && { BonusAmount: input.BonusAmount }),
3794
- ...(input.Reason !== undefined && input.Reason !== null && { Reason: input.Reason }),
3795
- ...(input.UniqueRequestToken !== undefined &&
3796
- input.UniqueRequestToken !== null && { UniqueRequestToken: input.UniqueRequestToken }),
3797
- ...(input.WorkerId !== undefined && input.WorkerId !== null && { WorkerId: input.WorkerId }),
3798
- };
3799
- };
3800
-
3801
- const serializeAws_json1_1SendTestEventNotificationRequest = (
3802
- input: SendTestEventNotificationRequest,
3803
- context: __SerdeContext
3804
- ): any => {
3805
- return {
3806
- ...(input.Notification !== undefined &&
3807
- input.Notification !== null && {
3808
- Notification: serializeAws_json1_1NotificationSpecification(input.Notification, context),
3809
- }),
3810
- ...(input.TestEventType !== undefined && input.TestEventType !== null && { TestEventType: input.TestEventType }),
3811
- };
3812
- };
3813
-
3814
- const serializeAws_json1_1StringList = (input: string[], context: __SerdeContext): any => {
3815
- return input
3816
- .filter((e: any) => e != null)
3817
- .map((entry) => {
3818
- if (entry === null) {
3819
- return null as any;
3820
- }
3821
- return entry;
3822
- });
3823
- };
3824
-
3825
- const serializeAws_json1_1UpdateExpirationForHITRequest = (
3826
- input: UpdateExpirationForHITRequest,
3827
- context: __SerdeContext
3828
- ): any => {
3829
- return {
3830
- ...(input.ExpireAt !== undefined &&
3831
- input.ExpireAt !== null && { ExpireAt: Math.round(input.ExpireAt.getTime() / 1000) }),
3832
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3833
- };
3834
- };
3835
-
3836
- const serializeAws_json1_1UpdateHITReviewStatusRequest = (
3837
- input: UpdateHITReviewStatusRequest,
3838
- context: __SerdeContext
3839
- ): any => {
3840
- return {
3841
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3842
- ...(input.Revert !== undefined && input.Revert !== null && { Revert: input.Revert }),
3843
- };
3844
- };
3845
-
3846
- const serializeAws_json1_1UpdateHITTypeOfHITRequest = (
3847
- input: UpdateHITTypeOfHITRequest,
3848
- context: __SerdeContext
3849
- ): any => {
3850
- return {
3851
- ...(input.HITId !== undefined && input.HITId !== null && { HITId: input.HITId }),
3852
- ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }),
3853
- };
3854
- };
3855
-
3856
- const serializeAws_json1_1UpdateNotificationSettingsRequest = (
3857
- input: UpdateNotificationSettingsRequest,
3858
- context: __SerdeContext
3859
- ): any => {
3860
- return {
3861
- ...(input.Active !== undefined && input.Active !== null && { Active: input.Active }),
3862
- ...(input.HITTypeId !== undefined && input.HITTypeId !== null && { HITTypeId: input.HITTypeId }),
3863
- ...(input.Notification !== undefined &&
3864
- input.Notification !== null && {
3865
- Notification: serializeAws_json1_1NotificationSpecification(input.Notification, context),
3866
- }),
3867
- };
3868
- };
3869
-
3870
- const serializeAws_json1_1UpdateQualificationTypeRequest = (
3871
- input: UpdateQualificationTypeRequest,
3872
- context: __SerdeContext
3873
- ): any => {
3874
- return {
3875
- ...(input.AnswerKey !== undefined && input.AnswerKey !== null && { AnswerKey: input.AnswerKey }),
3876
- ...(input.AutoGranted !== undefined && input.AutoGranted !== null && { AutoGranted: input.AutoGranted }),
3877
- ...(input.AutoGrantedValue !== undefined &&
3878
- input.AutoGrantedValue !== null && { AutoGrantedValue: input.AutoGrantedValue }),
3879
- ...(input.Description !== undefined && input.Description !== null && { Description: input.Description }),
3880
- ...(input.QualificationTypeId !== undefined &&
3881
- input.QualificationTypeId !== null && { QualificationTypeId: input.QualificationTypeId }),
3882
- ...(input.QualificationTypeStatus !== undefined &&
3883
- input.QualificationTypeStatus !== null && { QualificationTypeStatus: input.QualificationTypeStatus }),
3884
- ...(input.RetryDelayInSeconds !== undefined &&
3885
- input.RetryDelayInSeconds !== null && { RetryDelayInSeconds: input.RetryDelayInSeconds }),
3886
- ...(input.Test !== undefined && input.Test !== null && { Test: input.Test }),
3887
- ...(input.TestDurationInSeconds !== undefined &&
3888
- input.TestDurationInSeconds !== null && { TestDurationInSeconds: input.TestDurationInSeconds }),
3889
- };
3890
- };
3891
-
3892
- const deserializeAws_json1_1AcceptQualificationRequestResponse = (
3893
- output: any,
3894
- context: __SerdeContext
3895
- ): AcceptQualificationRequestResponse => {
3896
- return {} as any;
3897
- };
3898
-
3899
- const deserializeAws_json1_1ApproveAssignmentResponse = (
3900
- output: any,
3901
- context: __SerdeContext
3902
- ): ApproveAssignmentResponse => {
3903
- return {} as any;
3904
- };
3905
-
3906
- const deserializeAws_json1_1Assignment = (output: any, context: __SerdeContext): Assignment => {
3907
- return {
3908
- AcceptTime:
3909
- output.AcceptTime !== undefined && output.AcceptTime !== null
3910
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AcceptTime)))
3911
- : undefined,
3912
- Answer: __expectString(output.Answer),
3913
- ApprovalTime:
3914
- output.ApprovalTime !== undefined && output.ApprovalTime !== null
3915
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ApprovalTime)))
3916
- : undefined,
3917
- AssignmentId: __expectString(output.AssignmentId),
3918
- AssignmentStatus: __expectString(output.AssignmentStatus),
3919
- AutoApprovalTime:
3920
- output.AutoApprovalTime !== undefined && output.AutoApprovalTime !== null
3921
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.AutoApprovalTime)))
3922
- : undefined,
3923
- Deadline:
3924
- output.Deadline !== undefined && output.Deadline !== null
3925
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Deadline)))
3926
- : undefined,
3927
- HITId: __expectString(output.HITId),
3928
- RejectionTime:
3929
- output.RejectionTime !== undefined && output.RejectionTime !== null
3930
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.RejectionTime)))
3931
- : undefined,
3932
- RequesterFeedback: __expectString(output.RequesterFeedback),
3933
- SubmitTime:
3934
- output.SubmitTime !== undefined && output.SubmitTime !== null
3935
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.SubmitTime)))
3936
- : undefined,
3937
- WorkerId: __expectString(output.WorkerId),
3938
- } as any;
3939
- };
3940
-
3941
- const deserializeAws_json1_1AssignmentList = (output: any, context: __SerdeContext): Assignment[] => {
3942
- return (output || [])
3943
- .filter((e: any) => e != null)
3944
- .map((entry: any) => {
3945
- if (entry === null) {
3946
- return null as any;
3947
- }
3948
- return deserializeAws_json1_1Assignment(entry, context);
3949
- });
3950
- };
3951
-
3952
- const deserializeAws_json1_1AssociateQualificationWithWorkerResponse = (
3953
- output: any,
3954
- context: __SerdeContext
3955
- ): AssociateQualificationWithWorkerResponse => {
3956
- return {} as any;
3957
- };
3958
-
3959
- const deserializeAws_json1_1BonusPayment = (output: any, context: __SerdeContext): BonusPayment => {
3960
- return {
3961
- AssignmentId: __expectString(output.AssignmentId),
3962
- BonusAmount: __expectString(output.BonusAmount),
3963
- GrantTime:
3964
- output.GrantTime !== undefined && output.GrantTime !== null
3965
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.GrantTime)))
3966
- : undefined,
3967
- Reason: __expectString(output.Reason),
3968
- WorkerId: __expectString(output.WorkerId),
3969
- } as any;
3970
- };
3971
-
3972
- const deserializeAws_json1_1BonusPaymentList = (output: any, context: __SerdeContext): BonusPayment[] => {
3973
- return (output || [])
3974
- .filter((e: any) => e != null)
3975
- .map((entry: any) => {
3976
- if (entry === null) {
3977
- return null as any;
3978
- }
3979
- return deserializeAws_json1_1BonusPayment(entry, context);
3980
- });
3981
- };
3982
-
3983
- const deserializeAws_json1_1CreateAdditionalAssignmentsForHITResponse = (
3984
- output: any,
3985
- context: __SerdeContext
3986
- ): CreateAdditionalAssignmentsForHITResponse => {
3987
- return {} as any;
3988
- };
3989
-
3990
- const deserializeAws_json1_1CreateHITResponse = (output: any, context: __SerdeContext): CreateHITResponse => {
3991
- return {
3992
- HIT: output.HIT !== undefined && output.HIT !== null ? deserializeAws_json1_1HIT(output.HIT, context) : undefined,
3993
- } as any;
3994
- };
3995
-
3996
- const deserializeAws_json1_1CreateHITTypeResponse = (output: any, context: __SerdeContext): CreateHITTypeResponse => {
3997
- return {
3998
- HITTypeId: __expectString(output.HITTypeId),
3999
- } as any;
4000
- };
4001
-
4002
- const deserializeAws_json1_1CreateHITWithHITTypeResponse = (
4003
- output: any,
4004
- context: __SerdeContext
4005
- ): CreateHITWithHITTypeResponse => {
4006
- return {
4007
- HIT: output.HIT !== undefined && output.HIT !== null ? deserializeAws_json1_1HIT(output.HIT, context) : undefined,
4008
- } as any;
4009
- };
4010
-
4011
- const deserializeAws_json1_1CreateQualificationTypeResponse = (
4012
- output: any,
4013
- context: __SerdeContext
4014
- ): CreateQualificationTypeResponse => {
4015
- return {
4016
- QualificationType:
4017
- output.QualificationType !== undefined && output.QualificationType !== null
4018
- ? deserializeAws_json1_1QualificationType(output.QualificationType, context)
4019
- : undefined,
4020
- } as any;
4021
- };
4022
-
4023
- const deserializeAws_json1_1CreateWorkerBlockResponse = (
4024
- output: any,
4025
- context: __SerdeContext
4026
- ): CreateWorkerBlockResponse => {
4027
- return {} as any;
4028
- };
4029
-
4030
- const deserializeAws_json1_1DeleteHITResponse = (output: any, context: __SerdeContext): DeleteHITResponse => {
4031
- return {} as any;
4032
- };
4033
-
4034
- const deserializeAws_json1_1DeleteQualificationTypeResponse = (
4035
- output: any,
4036
- context: __SerdeContext
4037
- ): DeleteQualificationTypeResponse => {
4038
- return {} as any;
4039
- };
4040
-
4041
- const deserializeAws_json1_1DeleteWorkerBlockResponse = (
4042
- output: any,
4043
- context: __SerdeContext
4044
- ): DeleteWorkerBlockResponse => {
4045
- return {} as any;
4046
- };
4047
-
4048
- const deserializeAws_json1_1DisassociateQualificationFromWorkerResponse = (
4049
- output: any,
4050
- context: __SerdeContext
4051
- ): DisassociateQualificationFromWorkerResponse => {
4052
- return {} as any;
4053
- };
4054
-
4055
- const deserializeAws_json1_1GetAccountBalanceResponse = (
4056
- output: any,
4057
- context: __SerdeContext
4058
- ): GetAccountBalanceResponse => {
4059
- return {
4060
- AvailableBalance: __expectString(output.AvailableBalance),
4061
- OnHoldBalance: __expectString(output.OnHoldBalance),
4062
- } as any;
4063
- };
4064
-
4065
- const deserializeAws_json1_1GetAssignmentResponse = (output: any, context: __SerdeContext): GetAssignmentResponse => {
4066
- return {
4067
- Assignment:
4068
- output.Assignment !== undefined && output.Assignment !== null
4069
- ? deserializeAws_json1_1Assignment(output.Assignment, context)
4070
- : undefined,
4071
- HIT: output.HIT !== undefined && output.HIT !== null ? deserializeAws_json1_1HIT(output.HIT, context) : undefined,
4072
- } as any;
4073
- };
4074
-
4075
- const deserializeAws_json1_1GetFileUploadURLResponse = (
4076
- output: any,
4077
- context: __SerdeContext
4078
- ): GetFileUploadURLResponse => {
4079
- return {
4080
- FileUploadURL: __expectString(output.FileUploadURL),
4081
- } as any;
4082
- };
4083
-
4084
- const deserializeAws_json1_1GetHITResponse = (output: any, context: __SerdeContext): GetHITResponse => {
4085
- return {
4086
- HIT: output.HIT !== undefined && output.HIT !== null ? deserializeAws_json1_1HIT(output.HIT, context) : undefined,
4087
- } as any;
4088
- };
4089
-
4090
- const deserializeAws_json1_1GetQualificationScoreResponse = (
4091
- output: any,
4092
- context: __SerdeContext
4093
- ): GetQualificationScoreResponse => {
4094
- return {
4095
- Qualification:
4096
- output.Qualification !== undefined && output.Qualification !== null
4097
- ? deserializeAws_json1_1Qualification(output.Qualification, context)
4098
- : undefined,
4099
- } as any;
4100
- };
4101
-
4102
- const deserializeAws_json1_1GetQualificationTypeResponse = (
4103
- output: any,
4104
- context: __SerdeContext
4105
- ): GetQualificationTypeResponse => {
4106
- return {
4107
- QualificationType:
4108
- output.QualificationType !== undefined && output.QualificationType !== null
4109
- ? deserializeAws_json1_1QualificationType(output.QualificationType, context)
4110
- : undefined,
4111
- } as any;
4112
- };
4113
-
4114
- const deserializeAws_json1_1HIT = (output: any, context: __SerdeContext): HIT => {
4115
- return {
4116
- AssignmentDurationInSeconds: __expectLong(output.AssignmentDurationInSeconds),
4117
- AutoApprovalDelayInSeconds: __expectLong(output.AutoApprovalDelayInSeconds),
4118
- CreationTime:
4119
- output.CreationTime !== undefined && output.CreationTime !== null
4120
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
4121
- : undefined,
4122
- Description: __expectString(output.Description),
4123
- Expiration:
4124
- output.Expiration !== undefined && output.Expiration !== null
4125
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.Expiration)))
4126
- : undefined,
4127
- HITGroupId: __expectString(output.HITGroupId),
4128
- HITId: __expectString(output.HITId),
4129
- HITLayoutId: __expectString(output.HITLayoutId),
4130
- HITReviewStatus: __expectString(output.HITReviewStatus),
4131
- HITStatus: __expectString(output.HITStatus),
4132
- HITTypeId: __expectString(output.HITTypeId),
4133
- Keywords: __expectString(output.Keywords),
4134
- MaxAssignments: __expectInt32(output.MaxAssignments),
4135
- NumberOfAssignmentsAvailable: __expectInt32(output.NumberOfAssignmentsAvailable),
4136
- NumberOfAssignmentsCompleted: __expectInt32(output.NumberOfAssignmentsCompleted),
4137
- NumberOfAssignmentsPending: __expectInt32(output.NumberOfAssignmentsPending),
4138
- QualificationRequirements:
4139
- output.QualificationRequirements !== undefined && output.QualificationRequirements !== null
4140
- ? deserializeAws_json1_1QualificationRequirementList(output.QualificationRequirements, context)
4141
- : undefined,
4142
- Question: __expectString(output.Question),
4143
- RequesterAnnotation: __expectString(output.RequesterAnnotation),
4144
- Reward: __expectString(output.Reward),
4145
- Title: __expectString(output.Title),
4146
- } as any;
4147
- };
4148
-
4149
- const deserializeAws_json1_1HITList = (output: any, context: __SerdeContext): HIT[] => {
4150
- return (output || [])
4151
- .filter((e: any) => e != null)
4152
- .map((entry: any) => {
4153
- if (entry === null) {
4154
- return null as any;
4155
- }
4156
- return deserializeAws_json1_1HIT(entry, context);
4157
- });
4158
- };
4159
-
4160
- const deserializeAws_json1_1IntegerList = (output: any, context: __SerdeContext): number[] => {
4161
- return (output || [])
4162
- .filter((e: any) => e != null)
4163
- .map((entry: any) => {
4164
- if (entry === null) {
4165
- return null as any;
4166
- }
4167
- return __expectInt32(entry) as any;
4168
- });
4169
- };
4170
-
4171
- const deserializeAws_json1_1ListAssignmentsForHITResponse = (
4172
- output: any,
4173
- context: __SerdeContext
4174
- ): ListAssignmentsForHITResponse => {
4175
- return {
4176
- Assignments:
4177
- output.Assignments !== undefined && output.Assignments !== null
4178
- ? deserializeAws_json1_1AssignmentList(output.Assignments, context)
4179
- : undefined,
4180
- NextToken: __expectString(output.NextToken),
4181
- NumResults: __expectInt32(output.NumResults),
4182
- } as any;
4183
- };
4184
-
4185
- const deserializeAws_json1_1ListBonusPaymentsResponse = (
4186
- output: any,
4187
- context: __SerdeContext
4188
- ): ListBonusPaymentsResponse => {
4189
- return {
4190
- BonusPayments:
4191
- output.BonusPayments !== undefined && output.BonusPayments !== null
4192
- ? deserializeAws_json1_1BonusPaymentList(output.BonusPayments, context)
4193
- : undefined,
4194
- NextToken: __expectString(output.NextToken),
4195
- NumResults: __expectInt32(output.NumResults),
4196
- } as any;
4197
- };
4198
-
4199
- const deserializeAws_json1_1ListHITsForQualificationTypeResponse = (
4200
- output: any,
4201
- context: __SerdeContext
4202
- ): ListHITsForQualificationTypeResponse => {
4203
- return {
4204
- HITs:
4205
- output.HITs !== undefined && output.HITs !== null
4206
- ? deserializeAws_json1_1HITList(output.HITs, context)
4207
- : undefined,
4208
- NextToken: __expectString(output.NextToken),
4209
- NumResults: __expectInt32(output.NumResults),
4210
- } as any;
4211
- };
4212
-
4213
- const deserializeAws_json1_1ListHITsResponse = (output: any, context: __SerdeContext): ListHITsResponse => {
4214
- return {
4215
- HITs:
4216
- output.HITs !== undefined && output.HITs !== null
4217
- ? deserializeAws_json1_1HITList(output.HITs, context)
4218
- : undefined,
4219
- NextToken: __expectString(output.NextToken),
4220
- NumResults: __expectInt32(output.NumResults),
4221
- } as any;
4222
- };
4223
-
4224
- const deserializeAws_json1_1ListQualificationRequestsResponse = (
4225
- output: any,
4226
- context: __SerdeContext
4227
- ): ListQualificationRequestsResponse => {
4228
- return {
4229
- NextToken: __expectString(output.NextToken),
4230
- NumResults: __expectInt32(output.NumResults),
4231
- QualificationRequests:
4232
- output.QualificationRequests !== undefined && output.QualificationRequests !== null
4233
- ? deserializeAws_json1_1QualificationRequestList(output.QualificationRequests, context)
4234
- : undefined,
4235
- } as any;
4236
- };
4237
-
4238
- const deserializeAws_json1_1ListQualificationTypesResponse = (
4239
- output: any,
4240
- context: __SerdeContext
4241
- ): ListQualificationTypesResponse => {
4242
- return {
4243
- NextToken: __expectString(output.NextToken),
4244
- NumResults: __expectInt32(output.NumResults),
4245
- QualificationTypes:
4246
- output.QualificationTypes !== undefined && output.QualificationTypes !== null
4247
- ? deserializeAws_json1_1QualificationTypeList(output.QualificationTypes, context)
4248
- : undefined,
4249
- } as any;
4250
- };
4251
-
4252
- const deserializeAws_json1_1ListReviewableHITsResponse = (
4253
- output: any,
4254
- context: __SerdeContext
4255
- ): ListReviewableHITsResponse => {
4256
- return {
4257
- HITs:
4258
- output.HITs !== undefined && output.HITs !== null
4259
- ? deserializeAws_json1_1HITList(output.HITs, context)
4260
- : undefined,
4261
- NextToken: __expectString(output.NextToken),
4262
- NumResults: __expectInt32(output.NumResults),
4263
- } as any;
4264
- };
4265
-
4266
- const deserializeAws_json1_1ListReviewPolicyResultsForHITResponse = (
4267
- output: any,
4268
- context: __SerdeContext
4269
- ): ListReviewPolicyResultsForHITResponse => {
4270
- return {
4271
- AssignmentReviewPolicy:
4272
- output.AssignmentReviewPolicy !== undefined && output.AssignmentReviewPolicy !== null
4273
- ? deserializeAws_json1_1ReviewPolicy(output.AssignmentReviewPolicy, context)
4274
- : undefined,
4275
- AssignmentReviewReport:
4276
- output.AssignmentReviewReport !== undefined && output.AssignmentReviewReport !== null
4277
- ? deserializeAws_json1_1ReviewReport(output.AssignmentReviewReport, context)
4278
- : undefined,
4279
- HITId: __expectString(output.HITId),
4280
- HITReviewPolicy:
4281
- output.HITReviewPolicy !== undefined && output.HITReviewPolicy !== null
4282
- ? deserializeAws_json1_1ReviewPolicy(output.HITReviewPolicy, context)
4283
- : undefined,
4284
- HITReviewReport:
4285
- output.HITReviewReport !== undefined && output.HITReviewReport !== null
4286
- ? deserializeAws_json1_1ReviewReport(output.HITReviewReport, context)
4287
- : undefined,
4288
- NextToken: __expectString(output.NextToken),
4289
- } as any;
4290
- };
4291
-
4292
- const deserializeAws_json1_1ListWorkerBlocksResponse = (
4293
- output: any,
4294
- context: __SerdeContext
4295
- ): ListWorkerBlocksResponse => {
4296
- return {
4297
- NextToken: __expectString(output.NextToken),
4298
- NumResults: __expectInt32(output.NumResults),
4299
- WorkerBlocks:
4300
- output.WorkerBlocks !== undefined && output.WorkerBlocks !== null
4301
- ? deserializeAws_json1_1WorkerBlockList(output.WorkerBlocks, context)
4302
- : undefined,
4303
- } as any;
4304
- };
4305
-
4306
- const deserializeAws_json1_1ListWorkersWithQualificationTypeResponse = (
4307
- output: any,
4308
- context: __SerdeContext
4309
- ): ListWorkersWithQualificationTypeResponse => {
4310
- return {
4311
- NextToken: __expectString(output.NextToken),
4312
- NumResults: __expectInt32(output.NumResults),
4313
- Qualifications:
4314
- output.Qualifications !== undefined && output.Qualifications !== null
4315
- ? deserializeAws_json1_1QualificationList(output.Qualifications, context)
4316
- : undefined,
4317
- } as any;
4318
- };
4319
-
4320
- const deserializeAws_json1_1Locale = (output: any, context: __SerdeContext): Locale => {
4321
- return {
4322
- Country: __expectString(output.Country),
4323
- Subdivision: __expectString(output.Subdivision),
4324
- } as any;
4325
- };
4326
-
4327
- const deserializeAws_json1_1LocaleList = (output: any, context: __SerdeContext): Locale[] => {
4328
- return (output || [])
4329
- .filter((e: any) => e != null)
4330
- .map((entry: any) => {
4331
- if (entry === null) {
4332
- return null as any;
4333
- }
4334
- return deserializeAws_json1_1Locale(entry, context);
4335
- });
4336
- };
4337
-
4338
- const deserializeAws_json1_1NotifyWorkersFailureStatus = (
4339
- output: any,
4340
- context: __SerdeContext
4341
- ): NotifyWorkersFailureStatus => {
4342
- return {
4343
- NotifyWorkersFailureCode: __expectString(output.NotifyWorkersFailureCode),
4344
- NotifyWorkersFailureMessage: __expectString(output.NotifyWorkersFailureMessage),
4345
- WorkerId: __expectString(output.WorkerId),
4346
- } as any;
4347
- };
4348
-
4349
- const deserializeAws_json1_1NotifyWorkersFailureStatusList = (
4350
- output: any,
4351
- context: __SerdeContext
4352
- ): NotifyWorkersFailureStatus[] => {
4353
- return (output || [])
4354
- .filter((e: any) => e != null)
4355
- .map((entry: any) => {
4356
- if (entry === null) {
4357
- return null as any;
4358
- }
4359
- return deserializeAws_json1_1NotifyWorkersFailureStatus(entry, context);
4360
- });
4361
- };
4362
-
4363
- const deserializeAws_json1_1NotifyWorkersResponse = (output: any, context: __SerdeContext): NotifyWorkersResponse => {
4364
- return {
4365
- NotifyWorkersFailureStatuses:
4366
- output.NotifyWorkersFailureStatuses !== undefined && output.NotifyWorkersFailureStatuses !== null
4367
- ? deserializeAws_json1_1NotifyWorkersFailureStatusList(output.NotifyWorkersFailureStatuses, context)
4368
- : undefined,
4369
- } as any;
4370
- };
4371
-
4372
- const deserializeAws_json1_1ParameterMapEntry = (output: any, context: __SerdeContext): ParameterMapEntry => {
4373
- return {
4374
- Key: __expectString(output.Key),
4375
- Values:
4376
- output.Values !== undefined && output.Values !== null
4377
- ? deserializeAws_json1_1StringList(output.Values, context)
4378
- : undefined,
4379
- } as any;
4380
- };
4381
-
4382
- const deserializeAws_json1_1ParameterMapEntryList = (output: any, context: __SerdeContext): ParameterMapEntry[] => {
4383
- return (output || [])
4384
- .filter((e: any) => e != null)
4385
- .map((entry: any) => {
4386
- if (entry === null) {
4387
- return null as any;
4388
- }
4389
- return deserializeAws_json1_1ParameterMapEntry(entry, context);
4390
- });
4391
- };
4392
-
4393
- const deserializeAws_json1_1PolicyParameter = (output: any, context: __SerdeContext): PolicyParameter => {
4394
- return {
4395
- Key: __expectString(output.Key),
4396
- MapEntries:
4397
- output.MapEntries !== undefined && output.MapEntries !== null
4398
- ? deserializeAws_json1_1ParameterMapEntryList(output.MapEntries, context)
4399
- : undefined,
4400
- Values:
4401
- output.Values !== undefined && output.Values !== null
4402
- ? deserializeAws_json1_1StringList(output.Values, context)
4403
- : undefined,
4404
- } as any;
4405
- };
4406
-
4407
- const deserializeAws_json1_1PolicyParameterList = (output: any, context: __SerdeContext): PolicyParameter[] => {
4408
- return (output || [])
4409
- .filter((e: any) => e != null)
4410
- .map((entry: any) => {
4411
- if (entry === null) {
4412
- return null as any;
4413
- }
4414
- return deserializeAws_json1_1PolicyParameter(entry, context);
4415
- });
4416
- };
4417
-
4418
- const deserializeAws_json1_1Qualification = (output: any, context: __SerdeContext): Qualification => {
4419
- return {
4420
- GrantTime:
4421
- output.GrantTime !== undefined && output.GrantTime !== null
4422
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.GrantTime)))
4423
- : undefined,
4424
- IntegerValue: __expectInt32(output.IntegerValue),
4425
- LocaleValue:
4426
- output.LocaleValue !== undefined && output.LocaleValue !== null
4427
- ? deserializeAws_json1_1Locale(output.LocaleValue, context)
4428
- : undefined,
4429
- QualificationTypeId: __expectString(output.QualificationTypeId),
4430
- Status: __expectString(output.Status),
4431
- WorkerId: __expectString(output.WorkerId),
4432
- } as any;
4433
- };
4434
-
4435
- const deserializeAws_json1_1QualificationList = (output: any, context: __SerdeContext): Qualification[] => {
4436
- return (output || [])
4437
- .filter((e: any) => e != null)
4438
- .map((entry: any) => {
4439
- if (entry === null) {
4440
- return null as any;
4441
- }
4442
- return deserializeAws_json1_1Qualification(entry, context);
4443
- });
4444
- };
4445
-
4446
- const deserializeAws_json1_1QualificationRequest = (output: any, context: __SerdeContext): QualificationRequest => {
4447
- return {
4448
- Answer: __expectString(output.Answer),
4449
- QualificationRequestId: __expectString(output.QualificationRequestId),
4450
- QualificationTypeId: __expectString(output.QualificationTypeId),
4451
- SubmitTime:
4452
- output.SubmitTime !== undefined && output.SubmitTime !== null
4453
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.SubmitTime)))
4454
- : undefined,
4455
- Test: __expectString(output.Test),
4456
- WorkerId: __expectString(output.WorkerId),
4457
- } as any;
4458
- };
4459
-
4460
- const deserializeAws_json1_1QualificationRequestList = (
4461
- output: any,
4462
- context: __SerdeContext
4463
- ): QualificationRequest[] => {
4464
- return (output || [])
4465
- .filter((e: any) => e != null)
4466
- .map((entry: any) => {
4467
- if (entry === null) {
4468
- return null as any;
4469
- }
4470
- return deserializeAws_json1_1QualificationRequest(entry, context);
4471
- });
4472
- };
4473
-
4474
- const deserializeAws_json1_1QualificationRequirement = (
4475
- output: any,
4476
- context: __SerdeContext
4477
- ): QualificationRequirement => {
4478
- return {
4479
- ActionsGuarded: __expectString(output.ActionsGuarded),
4480
- Comparator: __expectString(output.Comparator),
4481
- IntegerValues:
4482
- output.IntegerValues !== undefined && output.IntegerValues !== null
4483
- ? deserializeAws_json1_1IntegerList(output.IntegerValues, context)
4484
- : undefined,
4485
- LocaleValues:
4486
- output.LocaleValues !== undefined && output.LocaleValues !== null
4487
- ? deserializeAws_json1_1LocaleList(output.LocaleValues, context)
4488
- : undefined,
4489
- QualificationTypeId: __expectString(output.QualificationTypeId),
4490
- RequiredToPreview: __expectBoolean(output.RequiredToPreview),
4491
- } as any;
4492
- };
4493
-
4494
- const deserializeAws_json1_1QualificationRequirementList = (
4495
- output: any,
4496
- context: __SerdeContext
4497
- ): QualificationRequirement[] => {
4498
- return (output || [])
4499
- .filter((e: any) => e != null)
4500
- .map((entry: any) => {
4501
- if (entry === null) {
4502
- return null as any;
4503
- }
4504
- return deserializeAws_json1_1QualificationRequirement(entry, context);
4505
- });
4506
- };
4507
-
4508
- const deserializeAws_json1_1QualificationType = (output: any, context: __SerdeContext): QualificationType => {
4509
- return {
4510
- AnswerKey: __expectString(output.AnswerKey),
4511
- AutoGranted: __expectBoolean(output.AutoGranted),
4512
- AutoGrantedValue: __expectInt32(output.AutoGrantedValue),
4513
- CreationTime:
4514
- output.CreationTime !== undefined && output.CreationTime !== null
4515
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationTime)))
4516
- : undefined,
4517
- Description: __expectString(output.Description),
4518
- IsRequestable: __expectBoolean(output.IsRequestable),
4519
- Keywords: __expectString(output.Keywords),
4520
- Name: __expectString(output.Name),
4521
- QualificationTypeId: __expectString(output.QualificationTypeId),
4522
- QualificationTypeStatus: __expectString(output.QualificationTypeStatus),
4523
- RetryDelayInSeconds: __expectLong(output.RetryDelayInSeconds),
4524
- Test: __expectString(output.Test),
4525
- TestDurationInSeconds: __expectLong(output.TestDurationInSeconds),
4526
- } as any;
4527
- };
4528
-
4529
- const deserializeAws_json1_1QualificationTypeList = (output: any, context: __SerdeContext): QualificationType[] => {
4530
- return (output || [])
4531
- .filter((e: any) => e != null)
4532
- .map((entry: any) => {
4533
- if (entry === null) {
4534
- return null as any;
4535
- }
4536
- return deserializeAws_json1_1QualificationType(entry, context);
4537
- });
4538
- };
4539
-
4540
- const deserializeAws_json1_1RejectAssignmentResponse = (
4541
- output: any,
4542
- context: __SerdeContext
4543
- ): RejectAssignmentResponse => {
4544
- return {} as any;
4545
- };
4546
-
4547
- const deserializeAws_json1_1RejectQualificationRequestResponse = (
4548
- output: any,
4549
- context: __SerdeContext
4550
- ): RejectQualificationRequestResponse => {
4551
- return {} as any;
4552
- };
4553
-
4554
- const deserializeAws_json1_1RequestError = (output: any, context: __SerdeContext): RequestError => {
4555
- return {
4556
- Message: __expectString(output.Message),
4557
- TurkErrorCode: __expectString(output.TurkErrorCode),
4558
- } as any;
4559
- };
4560
-
4561
- const deserializeAws_json1_1ReviewActionDetail = (output: any, context: __SerdeContext): ReviewActionDetail => {
4562
- return {
4563
- ActionId: __expectString(output.ActionId),
4564
- ActionName: __expectString(output.ActionName),
4565
- CompleteTime:
4566
- output.CompleteTime !== undefined && output.CompleteTime !== null
4567
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CompleteTime)))
4568
- : undefined,
4569
- ErrorCode: __expectString(output.ErrorCode),
4570
- Result: __expectString(output.Result),
4571
- Status: __expectString(output.Status),
4572
- TargetId: __expectString(output.TargetId),
4573
- TargetType: __expectString(output.TargetType),
4574
- } as any;
4575
- };
4576
-
4577
- const deserializeAws_json1_1ReviewActionDetailList = (output: any, context: __SerdeContext): ReviewActionDetail[] => {
4578
- return (output || [])
4579
- .filter((e: any) => e != null)
4580
- .map((entry: any) => {
4581
- if (entry === null) {
4582
- return null as any;
4583
- }
4584
- return deserializeAws_json1_1ReviewActionDetail(entry, context);
4585
- });
4586
- };
4587
-
4588
- const deserializeAws_json1_1ReviewPolicy = (output: any, context: __SerdeContext): ReviewPolicy => {
4589
- return {
4590
- Parameters:
4591
- output.Parameters !== undefined && output.Parameters !== null
4592
- ? deserializeAws_json1_1PolicyParameterList(output.Parameters, context)
4593
- : undefined,
4594
- PolicyName: __expectString(output.PolicyName),
4595
- } as any;
4596
- };
4597
-
4598
- const deserializeAws_json1_1ReviewReport = (output: any, context: __SerdeContext): ReviewReport => {
4599
- return {
4600
- ReviewActions:
4601
- output.ReviewActions !== undefined && output.ReviewActions !== null
4602
- ? deserializeAws_json1_1ReviewActionDetailList(output.ReviewActions, context)
4603
- : undefined,
4604
- ReviewResults:
4605
- output.ReviewResults !== undefined && output.ReviewResults !== null
4606
- ? deserializeAws_json1_1ReviewResultDetailList(output.ReviewResults, context)
4607
- : undefined,
4608
- } as any;
4609
- };
4610
-
4611
- const deserializeAws_json1_1ReviewResultDetail = (output: any, context: __SerdeContext): ReviewResultDetail => {
4612
- return {
4613
- ActionId: __expectString(output.ActionId),
4614
- Key: __expectString(output.Key),
4615
- QuestionId: __expectString(output.QuestionId),
4616
- SubjectId: __expectString(output.SubjectId),
4617
- SubjectType: __expectString(output.SubjectType),
4618
- Value: __expectString(output.Value),
4619
- } as any;
4620
- };
4621
-
4622
- const deserializeAws_json1_1ReviewResultDetailList = (output: any, context: __SerdeContext): ReviewResultDetail[] => {
4623
- return (output || [])
4624
- .filter((e: any) => e != null)
4625
- .map((entry: any) => {
4626
- if (entry === null) {
4627
- return null as any;
4628
- }
4629
- return deserializeAws_json1_1ReviewResultDetail(entry, context);
4630
- });
4631
- };
4632
-
4633
- const deserializeAws_json1_1SendBonusResponse = (output: any, context: __SerdeContext): SendBonusResponse => {
4634
- return {} as any;
4635
- };
4636
-
4637
- const deserializeAws_json1_1SendTestEventNotificationResponse = (
4638
- output: any,
4639
- context: __SerdeContext
4640
- ): SendTestEventNotificationResponse => {
4641
- return {} as any;
4642
- };
4643
-
4644
- const deserializeAws_json1_1ServiceFault = (output: any, context: __SerdeContext): ServiceFault => {
4645
- return {
4646
- Message: __expectString(output.Message),
4647
- TurkErrorCode: __expectString(output.TurkErrorCode),
4648
- } as any;
4649
- };
4650
-
4651
- const deserializeAws_json1_1StringList = (output: any, context: __SerdeContext): string[] => {
4652
- return (output || [])
4653
- .filter((e: any) => e != null)
4654
- .map((entry: any) => {
4655
- if (entry === null) {
4656
- return null as any;
4657
- }
4658
- return __expectString(entry) as any;
4659
- });
4660
- };
4661
-
4662
- const deserializeAws_json1_1UpdateExpirationForHITResponse = (
4663
- output: any,
4664
- context: __SerdeContext
4665
- ): UpdateExpirationForHITResponse => {
4666
- return {} as any;
4667
- };
4668
-
4669
- const deserializeAws_json1_1UpdateHITReviewStatusResponse = (
4670
- output: any,
4671
- context: __SerdeContext
4672
- ): UpdateHITReviewStatusResponse => {
4673
- return {} as any;
4674
- };
4675
-
4676
- const deserializeAws_json1_1UpdateHITTypeOfHITResponse = (
4677
- output: any,
4678
- context: __SerdeContext
4679
- ): UpdateHITTypeOfHITResponse => {
4680
- return {} as any;
4681
- };
4682
-
4683
- const deserializeAws_json1_1UpdateNotificationSettingsResponse = (
4684
- output: any,
4685
- context: __SerdeContext
4686
- ): UpdateNotificationSettingsResponse => {
4687
- return {} as any;
4688
- };
4689
-
4690
- const deserializeAws_json1_1UpdateQualificationTypeResponse = (
4691
- output: any,
4692
- context: __SerdeContext
4693
- ): UpdateQualificationTypeResponse => {
4694
- return {
4695
- QualificationType:
4696
- output.QualificationType !== undefined && output.QualificationType !== null
4697
- ? deserializeAws_json1_1QualificationType(output.QualificationType, context)
4698
- : undefined,
4699
- } as any;
4700
- };
4701
-
4702
- const deserializeAws_json1_1WorkerBlock = (output: any, context: __SerdeContext): WorkerBlock => {
4703
- return {
4704
- Reason: __expectString(output.Reason),
4705
- WorkerId: __expectString(output.WorkerId),
4706
- } as any;
4707
- };
4708
-
4709
- const deserializeAws_json1_1WorkerBlockList = (output: any, context: __SerdeContext): WorkerBlock[] => {
4710
- return (output || [])
4711
- .filter((e: any) => e != null)
4712
- .map((entry: any) => {
4713
- if (entry === null) {
4714
- return null as any;
4715
- }
4716
- return deserializeAws_json1_1WorkerBlock(entry, context);
4717
- });
4718
- };
4719
-
4720
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
4721
- httpStatusCode: output.statusCode,
4722
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
4723
- extendedRequestId: output.headers["x-amz-id-2"],
4724
- cfId: output.headers["x-amz-cf-id"],
4725
- });
4726
-
4727
- // Collect low-level response body stream to Uint8Array.
4728
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
4729
- if (streamBody instanceof Uint8Array) {
4730
- return Promise.resolve(streamBody);
4731
- }
4732
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
4733
- };
4734
-
4735
- // Encode Uint8Array data into string with utf-8.
4736
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
4737
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
4738
-
4739
- const buildHttpRpcRequest = async (
4740
- context: __SerdeContext,
4741
- headers: __HeaderBag,
4742
- path: string,
4743
- resolvedHostname: string | undefined,
4744
- body: any
4745
- ): Promise<__HttpRequest> => {
4746
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
4747
- const contents: any = {
4748
- protocol,
4749
- hostname,
4750
- port,
4751
- method: "POST",
4752
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
4753
- headers,
4754
- };
4755
- if (resolvedHostname !== undefined) {
4756
- contents.hostname = resolvedHostname;
4757
- }
4758
- if (body !== undefined) {
4759
- contents.body = body;
4760
- }
4761
- return new __HttpRequest(contents);
4762
- };
4763
-
4764
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
4765
- collectBodyString(streamBody, context).then((encoded) => {
4766
- if (encoded.length) {
4767
- return JSON.parse(encoded);
4768
- }
4769
- return {};
4770
- });
4771
-
4772
- /**
4773
- * Load an error code for the aws.rest-json-1.1 protocol.
4774
- */
4775
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
4776
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
4777
-
4778
- const sanitizeErrorCode = (rawValue: string): string => {
4779
- let cleanValue = rawValue;
4780
- if (cleanValue.indexOf(":") >= 0) {
4781
- cleanValue = cleanValue.split(":")[0];
4782
- }
4783
- if (cleanValue.indexOf("#") >= 0) {
4784
- cleanValue = cleanValue.split("#")[1];
4785
- }
4786
- return cleanValue;
4787
- };
4788
-
4789
- const headerKey = findKey(output.headers, "x-amzn-errortype");
4790
- if (headerKey !== undefined) {
4791
- return sanitizeErrorCode(output.headers[headerKey]);
4792
- }
4793
-
4794
- if (data.code !== undefined) {
4795
- return sanitizeErrorCode(data.code);
4796
- }
4797
-
4798
- if (data["__type"] !== undefined) {
4799
- return sanitizeErrorCode(data["__type"]);
4800
- }
4801
-
4802
- return "";
4803
- };