@aws-sdk/client-mturk 3.489.0 → 3.495.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 (63) hide show
  1. package/dist-cjs/MTurk.js +1 -89
  2. package/dist-cjs/MTurkClient.js +1 -43
  3. package/dist-cjs/commands/AcceptQualificationRequestCommand.js +1 -28
  4. package/dist-cjs/commands/ApproveAssignmentCommand.js +1 -28
  5. package/dist-cjs/commands/AssociateQualificationWithWorkerCommand.js +1 -28
  6. package/dist-cjs/commands/CreateAdditionalAssignmentsForHITCommand.js +1 -28
  7. package/dist-cjs/commands/CreateHITCommand.js +1 -28
  8. package/dist-cjs/commands/CreateHITTypeCommand.js +1 -28
  9. package/dist-cjs/commands/CreateHITWithHITTypeCommand.js +1 -28
  10. package/dist-cjs/commands/CreateQualificationTypeCommand.js +1 -28
  11. package/dist-cjs/commands/CreateWorkerBlockCommand.js +1 -28
  12. package/dist-cjs/commands/DeleteHITCommand.js +1 -28
  13. package/dist-cjs/commands/DeleteQualificationTypeCommand.js +1 -28
  14. package/dist-cjs/commands/DeleteWorkerBlockCommand.js +1 -28
  15. package/dist-cjs/commands/DisassociateQualificationFromWorkerCommand.js +1 -28
  16. package/dist-cjs/commands/GetAccountBalanceCommand.js +1 -28
  17. package/dist-cjs/commands/GetAssignmentCommand.js +1 -28
  18. package/dist-cjs/commands/GetFileUploadURLCommand.js +1 -28
  19. package/dist-cjs/commands/GetHITCommand.js +1 -28
  20. package/dist-cjs/commands/GetQualificationScoreCommand.js +1 -28
  21. package/dist-cjs/commands/GetQualificationTypeCommand.js +1 -28
  22. package/dist-cjs/commands/ListAssignmentsForHITCommand.js +1 -28
  23. package/dist-cjs/commands/ListBonusPaymentsCommand.js +1 -28
  24. package/dist-cjs/commands/ListHITsCommand.js +1 -28
  25. package/dist-cjs/commands/ListHITsForQualificationTypeCommand.js +1 -28
  26. package/dist-cjs/commands/ListQualificationRequestsCommand.js +1 -28
  27. package/dist-cjs/commands/ListQualificationTypesCommand.js +1 -28
  28. package/dist-cjs/commands/ListReviewPolicyResultsForHITCommand.js +1 -28
  29. package/dist-cjs/commands/ListReviewableHITsCommand.js +1 -28
  30. package/dist-cjs/commands/ListWorkerBlocksCommand.js +1 -28
  31. package/dist-cjs/commands/ListWorkersWithQualificationTypeCommand.js +1 -28
  32. package/dist-cjs/commands/NotifyWorkersCommand.js +1 -28
  33. package/dist-cjs/commands/RejectAssignmentCommand.js +1 -28
  34. package/dist-cjs/commands/RejectQualificationRequestCommand.js +1 -28
  35. package/dist-cjs/commands/SendBonusCommand.js +1 -28
  36. package/dist-cjs/commands/SendTestEventNotificationCommand.js +1 -28
  37. package/dist-cjs/commands/UpdateExpirationForHITCommand.js +1 -28
  38. package/dist-cjs/commands/UpdateHITReviewStatusCommand.js +1 -28
  39. package/dist-cjs/commands/UpdateHITTypeOfHITCommand.js +1 -28
  40. package/dist-cjs/commands/UpdateNotificationSettingsCommand.js +1 -28
  41. package/dist-cjs/commands/UpdateQualificationTypeCommand.js +1 -28
  42. package/dist-cjs/commands/index.js +1 -42
  43. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  44. package/dist-cjs/extensionConfiguration.js +1 -2
  45. package/dist-cjs/index.js +3097 -11
  46. package/dist-cjs/models/MTurkServiceException.js +1 -12
  47. package/dist-cjs/models/index.js +1 -4
  48. package/dist-cjs/models/models_0.js +1 -114
  49. package/dist-cjs/pagination/Interfaces.js +1 -2
  50. package/dist-cjs/pagination/ListAssignmentsForHITPaginator.js +1 -7
  51. package/dist-cjs/pagination/ListBonusPaymentsPaginator.js +1 -7
  52. package/dist-cjs/pagination/ListHITsForQualificationTypePaginator.js +1 -7
  53. package/dist-cjs/pagination/ListHITsPaginator.js +1 -7
  54. package/dist-cjs/pagination/ListQualificationRequestsPaginator.js +1 -7
  55. package/dist-cjs/pagination/ListQualificationTypesPaginator.js +1 -7
  56. package/dist-cjs/pagination/ListReviewPolicyResultsForHITPaginator.js +1 -7
  57. package/dist-cjs/pagination/ListReviewableHITsPaginator.js +1 -7
  58. package/dist-cjs/pagination/ListWorkerBlocksPaginator.js +1 -7
  59. package/dist-cjs/pagination/ListWorkersWithQualificationTypePaginator.js +1 -7
  60. package/dist-cjs/pagination/index.js +1 -14
  61. package/dist-cjs/protocols/Aws_json1_1.js +1 -2049
  62. package/dist-cjs/runtimeExtensions.js +1 -22
  63. package/package.json +40 -40
@@ -1,2049 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_DeleteQualificationTypeCommand = exports.de_DeleteHITCommand = exports.de_CreateWorkerBlockCommand = exports.de_CreateQualificationTypeCommand = exports.de_CreateHITWithHITTypeCommand = exports.de_CreateHITTypeCommand = exports.de_CreateHITCommand = exports.de_CreateAdditionalAssignmentsForHITCommand = exports.de_AssociateQualificationWithWorkerCommand = exports.de_ApproveAssignmentCommand = exports.de_AcceptQualificationRequestCommand = exports.se_UpdateQualificationTypeCommand = exports.se_UpdateNotificationSettingsCommand = exports.se_UpdateHITTypeOfHITCommand = exports.se_UpdateHITReviewStatusCommand = exports.se_UpdateExpirationForHITCommand = exports.se_SendTestEventNotificationCommand = exports.se_SendBonusCommand = exports.se_RejectQualificationRequestCommand = exports.se_RejectAssignmentCommand = exports.se_NotifyWorkersCommand = exports.se_ListWorkersWithQualificationTypeCommand = exports.se_ListWorkerBlocksCommand = exports.se_ListReviewPolicyResultsForHITCommand = exports.se_ListReviewableHITsCommand = exports.se_ListQualificationTypesCommand = exports.se_ListQualificationRequestsCommand = exports.se_ListHITsForQualificationTypeCommand = exports.se_ListHITsCommand = exports.se_ListBonusPaymentsCommand = exports.se_ListAssignmentsForHITCommand = exports.se_GetQualificationTypeCommand = exports.se_GetQualificationScoreCommand = exports.se_GetHITCommand = exports.se_GetFileUploadURLCommand = exports.se_GetAssignmentCommand = exports.se_GetAccountBalanceCommand = exports.se_DisassociateQualificationFromWorkerCommand = exports.se_DeleteWorkerBlockCommand = exports.se_DeleteQualificationTypeCommand = exports.se_DeleteHITCommand = exports.se_CreateWorkerBlockCommand = exports.se_CreateQualificationTypeCommand = exports.se_CreateHITWithHITTypeCommand = exports.se_CreateHITTypeCommand = exports.se_CreateHITCommand = exports.se_CreateAdditionalAssignmentsForHITCommand = exports.se_AssociateQualificationWithWorkerCommand = exports.se_ApproveAssignmentCommand = exports.se_AcceptQualificationRequestCommand = void 0;
4
- exports.de_UpdateQualificationTypeCommand = exports.de_UpdateNotificationSettingsCommand = exports.de_UpdateHITTypeOfHITCommand = exports.de_UpdateHITReviewStatusCommand = exports.de_UpdateExpirationForHITCommand = exports.de_SendTestEventNotificationCommand = exports.de_SendBonusCommand = exports.de_RejectQualificationRequestCommand = exports.de_RejectAssignmentCommand = exports.de_NotifyWorkersCommand = exports.de_ListWorkersWithQualificationTypeCommand = exports.de_ListWorkerBlocksCommand = exports.de_ListReviewPolicyResultsForHITCommand = exports.de_ListReviewableHITsCommand = exports.de_ListQualificationTypesCommand = exports.de_ListQualificationRequestsCommand = exports.de_ListHITsForQualificationTypeCommand = exports.de_ListHITsCommand = exports.de_ListBonusPaymentsCommand = exports.de_ListAssignmentsForHITCommand = exports.de_GetQualificationTypeCommand = exports.de_GetQualificationScoreCommand = exports.de_GetHITCommand = exports.de_GetFileUploadURLCommand = exports.de_GetAssignmentCommand = exports.de_GetAccountBalanceCommand = exports.de_DisassociateQualificationFromWorkerCommand = exports.de_DeleteWorkerBlockCommand = void 0;
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const models_0_1 = require("../models/models_0");
8
- const MTurkServiceException_1 = require("../models/MTurkServiceException");
9
- const se_AcceptQualificationRequestCommand = async (input, context) => {
10
- const headers = sharedHeaders("AcceptQualificationRequest");
11
- let body;
12
- body = JSON.stringify((0, smithy_client_1._json)(input));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- exports.se_AcceptQualificationRequestCommand = se_AcceptQualificationRequestCommand;
16
- const se_ApproveAssignmentCommand = async (input, context) => {
17
- const headers = sharedHeaders("ApproveAssignment");
18
- let body;
19
- body = JSON.stringify((0, smithy_client_1._json)(input));
20
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
21
- };
22
- exports.se_ApproveAssignmentCommand = se_ApproveAssignmentCommand;
23
- const se_AssociateQualificationWithWorkerCommand = async (input, context) => {
24
- const headers = sharedHeaders("AssociateQualificationWithWorker");
25
- let body;
26
- body = JSON.stringify((0, smithy_client_1._json)(input));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- exports.se_AssociateQualificationWithWorkerCommand = se_AssociateQualificationWithWorkerCommand;
30
- const se_CreateAdditionalAssignmentsForHITCommand = async (input, context) => {
31
- const headers = sharedHeaders("CreateAdditionalAssignmentsForHIT");
32
- let body;
33
- body = JSON.stringify((0, smithy_client_1._json)(input));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- exports.se_CreateAdditionalAssignmentsForHITCommand = se_CreateAdditionalAssignmentsForHITCommand;
37
- const se_CreateHITCommand = async (input, context) => {
38
- const headers = sharedHeaders("CreateHIT");
39
- let body;
40
- body = JSON.stringify((0, smithy_client_1._json)(input));
41
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
42
- };
43
- exports.se_CreateHITCommand = se_CreateHITCommand;
44
- const se_CreateHITTypeCommand = async (input, context) => {
45
- const headers = sharedHeaders("CreateHITType");
46
- let body;
47
- body = JSON.stringify((0, smithy_client_1._json)(input));
48
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
- };
50
- exports.se_CreateHITTypeCommand = se_CreateHITTypeCommand;
51
- const se_CreateHITWithHITTypeCommand = async (input, context) => {
52
- const headers = sharedHeaders("CreateHITWithHITType");
53
- let body;
54
- body = JSON.stringify((0, smithy_client_1._json)(input));
55
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
56
- };
57
- exports.se_CreateHITWithHITTypeCommand = se_CreateHITWithHITTypeCommand;
58
- const se_CreateQualificationTypeCommand = async (input, context) => {
59
- const headers = sharedHeaders("CreateQualificationType");
60
- let body;
61
- body = JSON.stringify((0, smithy_client_1._json)(input));
62
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
63
- };
64
- exports.se_CreateQualificationTypeCommand = se_CreateQualificationTypeCommand;
65
- const se_CreateWorkerBlockCommand = async (input, context) => {
66
- const headers = sharedHeaders("CreateWorkerBlock");
67
- let body;
68
- body = JSON.stringify((0, smithy_client_1._json)(input));
69
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
- };
71
- exports.se_CreateWorkerBlockCommand = se_CreateWorkerBlockCommand;
72
- const se_DeleteHITCommand = async (input, context) => {
73
- const headers = sharedHeaders("DeleteHIT");
74
- let body;
75
- body = JSON.stringify((0, smithy_client_1._json)(input));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- exports.se_DeleteHITCommand = se_DeleteHITCommand;
79
- const se_DeleteQualificationTypeCommand = async (input, context) => {
80
- const headers = sharedHeaders("DeleteQualificationType");
81
- let body;
82
- body = JSON.stringify((0, smithy_client_1._json)(input));
83
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
84
- };
85
- exports.se_DeleteQualificationTypeCommand = se_DeleteQualificationTypeCommand;
86
- const se_DeleteWorkerBlockCommand = async (input, context) => {
87
- const headers = sharedHeaders("DeleteWorkerBlock");
88
- let body;
89
- body = JSON.stringify((0, smithy_client_1._json)(input));
90
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
91
- };
92
- exports.se_DeleteWorkerBlockCommand = se_DeleteWorkerBlockCommand;
93
- const se_DisassociateQualificationFromWorkerCommand = async (input, context) => {
94
- const headers = sharedHeaders("DisassociateQualificationFromWorker");
95
- let body;
96
- body = JSON.stringify((0, smithy_client_1._json)(input));
97
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
98
- };
99
- exports.se_DisassociateQualificationFromWorkerCommand = se_DisassociateQualificationFromWorkerCommand;
100
- const se_GetAccountBalanceCommand = async (input, context) => {
101
- const headers = sharedHeaders("GetAccountBalance");
102
- let body;
103
- body = JSON.stringify((0, smithy_client_1._json)(input));
104
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
105
- };
106
- exports.se_GetAccountBalanceCommand = se_GetAccountBalanceCommand;
107
- const se_GetAssignmentCommand = async (input, context) => {
108
- const headers = sharedHeaders("GetAssignment");
109
- let body;
110
- body = JSON.stringify((0, smithy_client_1._json)(input));
111
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
- };
113
- exports.se_GetAssignmentCommand = se_GetAssignmentCommand;
114
- const se_GetFileUploadURLCommand = async (input, context) => {
115
- const headers = sharedHeaders("GetFileUploadURL");
116
- let body;
117
- body = JSON.stringify((0, smithy_client_1._json)(input));
118
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
119
- };
120
- exports.se_GetFileUploadURLCommand = se_GetFileUploadURLCommand;
121
- const se_GetHITCommand = async (input, context) => {
122
- const headers = sharedHeaders("GetHIT");
123
- let body;
124
- body = JSON.stringify((0, smithy_client_1._json)(input));
125
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
126
- };
127
- exports.se_GetHITCommand = se_GetHITCommand;
128
- const se_GetQualificationScoreCommand = async (input, context) => {
129
- const headers = sharedHeaders("GetQualificationScore");
130
- let body;
131
- body = JSON.stringify((0, smithy_client_1._json)(input));
132
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
133
- };
134
- exports.se_GetQualificationScoreCommand = se_GetQualificationScoreCommand;
135
- const se_GetQualificationTypeCommand = async (input, context) => {
136
- const headers = sharedHeaders("GetQualificationType");
137
- let body;
138
- body = JSON.stringify((0, smithy_client_1._json)(input));
139
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
- };
141
- exports.se_GetQualificationTypeCommand = se_GetQualificationTypeCommand;
142
- const se_ListAssignmentsForHITCommand = async (input, context) => {
143
- const headers = sharedHeaders("ListAssignmentsForHIT");
144
- let body;
145
- body = JSON.stringify((0, smithy_client_1._json)(input));
146
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
- };
148
- exports.se_ListAssignmentsForHITCommand = se_ListAssignmentsForHITCommand;
149
- const se_ListBonusPaymentsCommand = async (input, context) => {
150
- const headers = sharedHeaders("ListBonusPayments");
151
- let body;
152
- body = JSON.stringify((0, smithy_client_1._json)(input));
153
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
154
- };
155
- exports.se_ListBonusPaymentsCommand = se_ListBonusPaymentsCommand;
156
- const se_ListHITsCommand = async (input, context) => {
157
- const headers = sharedHeaders("ListHITs");
158
- let body;
159
- body = JSON.stringify((0, smithy_client_1._json)(input));
160
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
161
- };
162
- exports.se_ListHITsCommand = se_ListHITsCommand;
163
- const se_ListHITsForQualificationTypeCommand = async (input, context) => {
164
- const headers = sharedHeaders("ListHITsForQualificationType");
165
- let body;
166
- body = JSON.stringify((0, smithy_client_1._json)(input));
167
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
168
- };
169
- exports.se_ListHITsForQualificationTypeCommand = se_ListHITsForQualificationTypeCommand;
170
- const se_ListQualificationRequestsCommand = async (input, context) => {
171
- const headers = sharedHeaders("ListQualificationRequests");
172
- let body;
173
- body = JSON.stringify((0, smithy_client_1._json)(input));
174
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
175
- };
176
- exports.se_ListQualificationRequestsCommand = se_ListQualificationRequestsCommand;
177
- const se_ListQualificationTypesCommand = async (input, context) => {
178
- const headers = sharedHeaders("ListQualificationTypes");
179
- let body;
180
- body = JSON.stringify((0, smithy_client_1._json)(input));
181
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
182
- };
183
- exports.se_ListQualificationTypesCommand = se_ListQualificationTypesCommand;
184
- const se_ListReviewableHITsCommand = async (input, context) => {
185
- const headers = sharedHeaders("ListReviewableHITs");
186
- let body;
187
- body = JSON.stringify((0, smithy_client_1._json)(input));
188
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
189
- };
190
- exports.se_ListReviewableHITsCommand = se_ListReviewableHITsCommand;
191
- const se_ListReviewPolicyResultsForHITCommand = async (input, context) => {
192
- const headers = sharedHeaders("ListReviewPolicyResultsForHIT");
193
- let body;
194
- body = JSON.stringify((0, smithy_client_1._json)(input));
195
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
196
- };
197
- exports.se_ListReviewPolicyResultsForHITCommand = se_ListReviewPolicyResultsForHITCommand;
198
- const se_ListWorkerBlocksCommand = async (input, context) => {
199
- const headers = sharedHeaders("ListWorkerBlocks");
200
- let body;
201
- body = JSON.stringify((0, smithy_client_1._json)(input));
202
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
203
- };
204
- exports.se_ListWorkerBlocksCommand = se_ListWorkerBlocksCommand;
205
- const se_ListWorkersWithQualificationTypeCommand = async (input, context) => {
206
- const headers = sharedHeaders("ListWorkersWithQualificationType");
207
- let body;
208
- body = JSON.stringify((0, smithy_client_1._json)(input));
209
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
210
- };
211
- exports.se_ListWorkersWithQualificationTypeCommand = se_ListWorkersWithQualificationTypeCommand;
212
- const se_NotifyWorkersCommand = async (input, context) => {
213
- const headers = sharedHeaders("NotifyWorkers");
214
- let body;
215
- body = JSON.stringify((0, smithy_client_1._json)(input));
216
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
217
- };
218
- exports.se_NotifyWorkersCommand = se_NotifyWorkersCommand;
219
- const se_RejectAssignmentCommand = async (input, context) => {
220
- const headers = sharedHeaders("RejectAssignment");
221
- let body;
222
- body = JSON.stringify((0, smithy_client_1._json)(input));
223
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
224
- };
225
- exports.se_RejectAssignmentCommand = se_RejectAssignmentCommand;
226
- const se_RejectQualificationRequestCommand = async (input, context) => {
227
- const headers = sharedHeaders("RejectQualificationRequest");
228
- let body;
229
- body = JSON.stringify((0, smithy_client_1._json)(input));
230
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
231
- };
232
- exports.se_RejectQualificationRequestCommand = se_RejectQualificationRequestCommand;
233
- const se_SendBonusCommand = async (input, context) => {
234
- const headers = sharedHeaders("SendBonus");
235
- let body;
236
- body = JSON.stringify((0, smithy_client_1._json)(input));
237
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
238
- };
239
- exports.se_SendBonusCommand = se_SendBonusCommand;
240
- const se_SendTestEventNotificationCommand = async (input, context) => {
241
- const headers = sharedHeaders("SendTestEventNotification");
242
- let body;
243
- body = JSON.stringify((0, smithy_client_1._json)(input));
244
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
245
- };
246
- exports.se_SendTestEventNotificationCommand = se_SendTestEventNotificationCommand;
247
- const se_UpdateExpirationForHITCommand = async (input, context) => {
248
- const headers = sharedHeaders("UpdateExpirationForHIT");
249
- let body;
250
- body = JSON.stringify(se_UpdateExpirationForHITRequest(input, context));
251
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
252
- };
253
- exports.se_UpdateExpirationForHITCommand = se_UpdateExpirationForHITCommand;
254
- const se_UpdateHITReviewStatusCommand = async (input, context) => {
255
- const headers = sharedHeaders("UpdateHITReviewStatus");
256
- let body;
257
- body = JSON.stringify((0, smithy_client_1._json)(input));
258
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
259
- };
260
- exports.se_UpdateHITReviewStatusCommand = se_UpdateHITReviewStatusCommand;
261
- const se_UpdateHITTypeOfHITCommand = async (input, context) => {
262
- const headers = sharedHeaders("UpdateHITTypeOfHIT");
263
- let body;
264
- body = JSON.stringify((0, smithy_client_1._json)(input));
265
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
266
- };
267
- exports.se_UpdateHITTypeOfHITCommand = se_UpdateHITTypeOfHITCommand;
268
- const se_UpdateNotificationSettingsCommand = async (input, context) => {
269
- const headers = sharedHeaders("UpdateNotificationSettings");
270
- let body;
271
- body = JSON.stringify((0, smithy_client_1._json)(input));
272
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
273
- };
274
- exports.se_UpdateNotificationSettingsCommand = se_UpdateNotificationSettingsCommand;
275
- const se_UpdateQualificationTypeCommand = async (input, context) => {
276
- const headers = sharedHeaders("UpdateQualificationType");
277
- let body;
278
- body = JSON.stringify((0, smithy_client_1._json)(input));
279
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
280
- };
281
- exports.se_UpdateQualificationTypeCommand = se_UpdateQualificationTypeCommand;
282
- const de_AcceptQualificationRequestCommand = async (output, context) => {
283
- if (output.statusCode >= 300) {
284
- return de_AcceptQualificationRequestCommandError(output, context);
285
- }
286
- const data = await parseBody(output.body, context);
287
- let contents = {};
288
- contents = (0, smithy_client_1._json)(data);
289
- const response = {
290
- $metadata: deserializeMetadata(output),
291
- ...contents,
292
- };
293
- return response;
294
- };
295
- exports.de_AcceptQualificationRequestCommand = de_AcceptQualificationRequestCommand;
296
- const de_AcceptQualificationRequestCommandError = async (output, context) => {
297
- const parsedOutput = {
298
- ...output,
299
- body: await parseErrorBody(output.body, context),
300
- };
301
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
302
- switch (errorCode) {
303
- case "RequestError":
304
- case "com.amazonaws.mturk#RequestError":
305
- throw await de_RequestErrorRes(parsedOutput, context);
306
- case "ServiceFault":
307
- case "com.amazonaws.mturk#ServiceFault":
308
- throw await de_ServiceFaultRes(parsedOutput, context);
309
- default:
310
- const parsedBody = parsedOutput.body;
311
- return throwDefaultError({
312
- output,
313
- parsedBody,
314
- errorCode,
315
- });
316
- }
317
- };
318
- const de_ApproveAssignmentCommand = async (output, context) => {
319
- if (output.statusCode >= 300) {
320
- return de_ApproveAssignmentCommandError(output, context);
321
- }
322
- const data = await parseBody(output.body, context);
323
- let contents = {};
324
- contents = (0, smithy_client_1._json)(data);
325
- const response = {
326
- $metadata: deserializeMetadata(output),
327
- ...contents,
328
- };
329
- return response;
330
- };
331
- exports.de_ApproveAssignmentCommand = de_ApproveAssignmentCommand;
332
- const de_ApproveAssignmentCommandError = async (output, context) => {
333
- const parsedOutput = {
334
- ...output,
335
- body: await parseErrorBody(output.body, context),
336
- };
337
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
338
- switch (errorCode) {
339
- case "RequestError":
340
- case "com.amazonaws.mturk#RequestError":
341
- throw await de_RequestErrorRes(parsedOutput, context);
342
- case "ServiceFault":
343
- case "com.amazonaws.mturk#ServiceFault":
344
- throw await de_ServiceFaultRes(parsedOutput, context);
345
- default:
346
- const parsedBody = parsedOutput.body;
347
- return throwDefaultError({
348
- output,
349
- parsedBody,
350
- errorCode,
351
- });
352
- }
353
- };
354
- const de_AssociateQualificationWithWorkerCommand = async (output, context) => {
355
- if (output.statusCode >= 300) {
356
- return de_AssociateQualificationWithWorkerCommandError(output, context);
357
- }
358
- const data = await parseBody(output.body, context);
359
- let contents = {};
360
- contents = (0, smithy_client_1._json)(data);
361
- const response = {
362
- $metadata: deserializeMetadata(output),
363
- ...contents,
364
- };
365
- return response;
366
- };
367
- exports.de_AssociateQualificationWithWorkerCommand = de_AssociateQualificationWithWorkerCommand;
368
- const de_AssociateQualificationWithWorkerCommandError = async (output, context) => {
369
- const parsedOutput = {
370
- ...output,
371
- body: await parseErrorBody(output.body, context),
372
- };
373
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
374
- switch (errorCode) {
375
- case "RequestError":
376
- case "com.amazonaws.mturk#RequestError":
377
- throw await de_RequestErrorRes(parsedOutput, context);
378
- case "ServiceFault":
379
- case "com.amazonaws.mturk#ServiceFault":
380
- throw await de_ServiceFaultRes(parsedOutput, context);
381
- default:
382
- const parsedBody = parsedOutput.body;
383
- return throwDefaultError({
384
- output,
385
- parsedBody,
386
- errorCode,
387
- });
388
- }
389
- };
390
- const de_CreateAdditionalAssignmentsForHITCommand = async (output, context) => {
391
- if (output.statusCode >= 300) {
392
- return de_CreateAdditionalAssignmentsForHITCommandError(output, context);
393
- }
394
- const data = await parseBody(output.body, context);
395
- let contents = {};
396
- contents = (0, smithy_client_1._json)(data);
397
- const response = {
398
- $metadata: deserializeMetadata(output),
399
- ...contents,
400
- };
401
- return response;
402
- };
403
- exports.de_CreateAdditionalAssignmentsForHITCommand = de_CreateAdditionalAssignmentsForHITCommand;
404
- const de_CreateAdditionalAssignmentsForHITCommandError = async (output, context) => {
405
- const parsedOutput = {
406
- ...output,
407
- body: await parseErrorBody(output.body, context),
408
- };
409
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
410
- switch (errorCode) {
411
- case "RequestError":
412
- case "com.amazonaws.mturk#RequestError":
413
- throw await de_RequestErrorRes(parsedOutput, context);
414
- case "ServiceFault":
415
- case "com.amazonaws.mturk#ServiceFault":
416
- throw await de_ServiceFaultRes(parsedOutput, context);
417
- default:
418
- const parsedBody = parsedOutput.body;
419
- return throwDefaultError({
420
- output,
421
- parsedBody,
422
- errorCode,
423
- });
424
- }
425
- };
426
- const de_CreateHITCommand = async (output, context) => {
427
- if (output.statusCode >= 300) {
428
- return de_CreateHITCommandError(output, context);
429
- }
430
- const data = await parseBody(output.body, context);
431
- let contents = {};
432
- contents = de_CreateHITResponse(data, context);
433
- const response = {
434
- $metadata: deserializeMetadata(output),
435
- ...contents,
436
- };
437
- return response;
438
- };
439
- exports.de_CreateHITCommand = de_CreateHITCommand;
440
- const de_CreateHITCommandError = async (output, context) => {
441
- const parsedOutput = {
442
- ...output,
443
- body: await parseErrorBody(output.body, context),
444
- };
445
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
446
- switch (errorCode) {
447
- case "RequestError":
448
- case "com.amazonaws.mturk#RequestError":
449
- throw await de_RequestErrorRes(parsedOutput, context);
450
- case "ServiceFault":
451
- case "com.amazonaws.mturk#ServiceFault":
452
- throw await de_ServiceFaultRes(parsedOutput, context);
453
- default:
454
- const parsedBody = parsedOutput.body;
455
- return throwDefaultError({
456
- output,
457
- parsedBody,
458
- errorCode,
459
- });
460
- }
461
- };
462
- const de_CreateHITTypeCommand = async (output, context) => {
463
- if (output.statusCode >= 300) {
464
- return de_CreateHITTypeCommandError(output, context);
465
- }
466
- const data = await parseBody(output.body, context);
467
- let contents = {};
468
- contents = (0, smithy_client_1._json)(data);
469
- const response = {
470
- $metadata: deserializeMetadata(output),
471
- ...contents,
472
- };
473
- return response;
474
- };
475
- exports.de_CreateHITTypeCommand = de_CreateHITTypeCommand;
476
- const de_CreateHITTypeCommandError = async (output, context) => {
477
- const parsedOutput = {
478
- ...output,
479
- body: await parseErrorBody(output.body, context),
480
- };
481
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
482
- switch (errorCode) {
483
- case "RequestError":
484
- case "com.amazonaws.mturk#RequestError":
485
- throw await de_RequestErrorRes(parsedOutput, context);
486
- case "ServiceFault":
487
- case "com.amazonaws.mturk#ServiceFault":
488
- throw await de_ServiceFaultRes(parsedOutput, context);
489
- default:
490
- const parsedBody = parsedOutput.body;
491
- return throwDefaultError({
492
- output,
493
- parsedBody,
494
- errorCode,
495
- });
496
- }
497
- };
498
- const de_CreateHITWithHITTypeCommand = async (output, context) => {
499
- if (output.statusCode >= 300) {
500
- return de_CreateHITWithHITTypeCommandError(output, context);
501
- }
502
- const data = await parseBody(output.body, context);
503
- let contents = {};
504
- contents = de_CreateHITWithHITTypeResponse(data, context);
505
- const response = {
506
- $metadata: deserializeMetadata(output),
507
- ...contents,
508
- };
509
- return response;
510
- };
511
- exports.de_CreateHITWithHITTypeCommand = de_CreateHITWithHITTypeCommand;
512
- const de_CreateHITWithHITTypeCommandError = async (output, context) => {
513
- const parsedOutput = {
514
- ...output,
515
- body: await parseErrorBody(output.body, context),
516
- };
517
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
518
- switch (errorCode) {
519
- case "RequestError":
520
- case "com.amazonaws.mturk#RequestError":
521
- throw await de_RequestErrorRes(parsedOutput, context);
522
- case "ServiceFault":
523
- case "com.amazonaws.mturk#ServiceFault":
524
- throw await de_ServiceFaultRes(parsedOutput, context);
525
- default:
526
- const parsedBody = parsedOutput.body;
527
- return throwDefaultError({
528
- output,
529
- parsedBody,
530
- errorCode,
531
- });
532
- }
533
- };
534
- const de_CreateQualificationTypeCommand = async (output, context) => {
535
- if (output.statusCode >= 300) {
536
- return de_CreateQualificationTypeCommandError(output, context);
537
- }
538
- const data = await parseBody(output.body, context);
539
- let contents = {};
540
- contents = de_CreateQualificationTypeResponse(data, context);
541
- const response = {
542
- $metadata: deserializeMetadata(output),
543
- ...contents,
544
- };
545
- return response;
546
- };
547
- exports.de_CreateQualificationTypeCommand = de_CreateQualificationTypeCommand;
548
- const de_CreateQualificationTypeCommandError = async (output, context) => {
549
- const parsedOutput = {
550
- ...output,
551
- body: await parseErrorBody(output.body, context),
552
- };
553
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
554
- switch (errorCode) {
555
- case "RequestError":
556
- case "com.amazonaws.mturk#RequestError":
557
- throw await de_RequestErrorRes(parsedOutput, context);
558
- case "ServiceFault":
559
- case "com.amazonaws.mturk#ServiceFault":
560
- throw await de_ServiceFaultRes(parsedOutput, context);
561
- default:
562
- const parsedBody = parsedOutput.body;
563
- return throwDefaultError({
564
- output,
565
- parsedBody,
566
- errorCode,
567
- });
568
- }
569
- };
570
- const de_CreateWorkerBlockCommand = async (output, context) => {
571
- if (output.statusCode >= 300) {
572
- return de_CreateWorkerBlockCommandError(output, context);
573
- }
574
- const data = await parseBody(output.body, context);
575
- let contents = {};
576
- contents = (0, smithy_client_1._json)(data);
577
- const response = {
578
- $metadata: deserializeMetadata(output),
579
- ...contents,
580
- };
581
- return response;
582
- };
583
- exports.de_CreateWorkerBlockCommand = de_CreateWorkerBlockCommand;
584
- const de_CreateWorkerBlockCommandError = async (output, context) => {
585
- const parsedOutput = {
586
- ...output,
587
- body: await parseErrorBody(output.body, context),
588
- };
589
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
590
- switch (errorCode) {
591
- case "RequestError":
592
- case "com.amazonaws.mturk#RequestError":
593
- throw await de_RequestErrorRes(parsedOutput, context);
594
- case "ServiceFault":
595
- case "com.amazonaws.mturk#ServiceFault":
596
- throw await de_ServiceFaultRes(parsedOutput, context);
597
- default:
598
- const parsedBody = parsedOutput.body;
599
- return throwDefaultError({
600
- output,
601
- parsedBody,
602
- errorCode,
603
- });
604
- }
605
- };
606
- const de_DeleteHITCommand = async (output, context) => {
607
- if (output.statusCode >= 300) {
608
- return de_DeleteHITCommandError(output, context);
609
- }
610
- const data = await parseBody(output.body, context);
611
- let contents = {};
612
- contents = (0, smithy_client_1._json)(data);
613
- const response = {
614
- $metadata: deserializeMetadata(output),
615
- ...contents,
616
- };
617
- return response;
618
- };
619
- exports.de_DeleteHITCommand = de_DeleteHITCommand;
620
- const de_DeleteHITCommandError = async (output, context) => {
621
- const parsedOutput = {
622
- ...output,
623
- body: await parseErrorBody(output.body, context),
624
- };
625
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
626
- switch (errorCode) {
627
- case "RequestError":
628
- case "com.amazonaws.mturk#RequestError":
629
- throw await de_RequestErrorRes(parsedOutput, context);
630
- case "ServiceFault":
631
- case "com.amazonaws.mturk#ServiceFault":
632
- throw await de_ServiceFaultRes(parsedOutput, context);
633
- default:
634
- const parsedBody = parsedOutput.body;
635
- return throwDefaultError({
636
- output,
637
- parsedBody,
638
- errorCode,
639
- });
640
- }
641
- };
642
- const de_DeleteQualificationTypeCommand = async (output, context) => {
643
- if (output.statusCode >= 300) {
644
- return de_DeleteQualificationTypeCommandError(output, context);
645
- }
646
- const data = await parseBody(output.body, context);
647
- let contents = {};
648
- contents = (0, smithy_client_1._json)(data);
649
- const response = {
650
- $metadata: deserializeMetadata(output),
651
- ...contents,
652
- };
653
- return response;
654
- };
655
- exports.de_DeleteQualificationTypeCommand = de_DeleteQualificationTypeCommand;
656
- const de_DeleteQualificationTypeCommandError = async (output, context) => {
657
- const parsedOutput = {
658
- ...output,
659
- body: await parseErrorBody(output.body, context),
660
- };
661
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
662
- switch (errorCode) {
663
- case "RequestError":
664
- case "com.amazonaws.mturk#RequestError":
665
- throw await de_RequestErrorRes(parsedOutput, context);
666
- case "ServiceFault":
667
- case "com.amazonaws.mturk#ServiceFault":
668
- throw await de_ServiceFaultRes(parsedOutput, context);
669
- default:
670
- const parsedBody = parsedOutput.body;
671
- return throwDefaultError({
672
- output,
673
- parsedBody,
674
- errorCode,
675
- });
676
- }
677
- };
678
- const de_DeleteWorkerBlockCommand = async (output, context) => {
679
- if (output.statusCode >= 300) {
680
- return de_DeleteWorkerBlockCommandError(output, context);
681
- }
682
- const data = await parseBody(output.body, context);
683
- let contents = {};
684
- contents = (0, smithy_client_1._json)(data);
685
- const response = {
686
- $metadata: deserializeMetadata(output),
687
- ...contents,
688
- };
689
- return response;
690
- };
691
- exports.de_DeleteWorkerBlockCommand = de_DeleteWorkerBlockCommand;
692
- const de_DeleteWorkerBlockCommandError = async (output, context) => {
693
- const parsedOutput = {
694
- ...output,
695
- body: await parseErrorBody(output.body, context),
696
- };
697
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
698
- switch (errorCode) {
699
- case "RequestError":
700
- case "com.amazonaws.mturk#RequestError":
701
- throw await de_RequestErrorRes(parsedOutput, context);
702
- case "ServiceFault":
703
- case "com.amazonaws.mturk#ServiceFault":
704
- throw await de_ServiceFaultRes(parsedOutput, context);
705
- default:
706
- const parsedBody = parsedOutput.body;
707
- return throwDefaultError({
708
- output,
709
- parsedBody,
710
- errorCode,
711
- });
712
- }
713
- };
714
- const de_DisassociateQualificationFromWorkerCommand = async (output, context) => {
715
- if (output.statusCode >= 300) {
716
- return de_DisassociateQualificationFromWorkerCommandError(output, context);
717
- }
718
- const data = await parseBody(output.body, context);
719
- let contents = {};
720
- contents = (0, smithy_client_1._json)(data);
721
- const response = {
722
- $metadata: deserializeMetadata(output),
723
- ...contents,
724
- };
725
- return response;
726
- };
727
- exports.de_DisassociateQualificationFromWorkerCommand = de_DisassociateQualificationFromWorkerCommand;
728
- const de_DisassociateQualificationFromWorkerCommandError = async (output, context) => {
729
- const parsedOutput = {
730
- ...output,
731
- body: await parseErrorBody(output.body, context),
732
- };
733
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
734
- switch (errorCode) {
735
- case "RequestError":
736
- case "com.amazonaws.mturk#RequestError":
737
- throw await de_RequestErrorRes(parsedOutput, context);
738
- case "ServiceFault":
739
- case "com.amazonaws.mturk#ServiceFault":
740
- throw await de_ServiceFaultRes(parsedOutput, context);
741
- default:
742
- const parsedBody = parsedOutput.body;
743
- return throwDefaultError({
744
- output,
745
- parsedBody,
746
- errorCode,
747
- });
748
- }
749
- };
750
- const de_GetAccountBalanceCommand = async (output, context) => {
751
- if (output.statusCode >= 300) {
752
- return de_GetAccountBalanceCommandError(output, context);
753
- }
754
- const data = await parseBody(output.body, context);
755
- let contents = {};
756
- contents = (0, smithy_client_1._json)(data);
757
- const response = {
758
- $metadata: deserializeMetadata(output),
759
- ...contents,
760
- };
761
- return response;
762
- };
763
- exports.de_GetAccountBalanceCommand = de_GetAccountBalanceCommand;
764
- const de_GetAccountBalanceCommandError = async (output, context) => {
765
- const parsedOutput = {
766
- ...output,
767
- body: await parseErrorBody(output.body, context),
768
- };
769
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
770
- switch (errorCode) {
771
- case "RequestError":
772
- case "com.amazonaws.mturk#RequestError":
773
- throw await de_RequestErrorRes(parsedOutput, context);
774
- case "ServiceFault":
775
- case "com.amazonaws.mturk#ServiceFault":
776
- throw await de_ServiceFaultRes(parsedOutput, context);
777
- default:
778
- const parsedBody = parsedOutput.body;
779
- return throwDefaultError({
780
- output,
781
- parsedBody,
782
- errorCode,
783
- });
784
- }
785
- };
786
- const de_GetAssignmentCommand = async (output, context) => {
787
- if (output.statusCode >= 300) {
788
- return de_GetAssignmentCommandError(output, context);
789
- }
790
- const data = await parseBody(output.body, context);
791
- let contents = {};
792
- contents = de_GetAssignmentResponse(data, context);
793
- const response = {
794
- $metadata: deserializeMetadata(output),
795
- ...contents,
796
- };
797
- return response;
798
- };
799
- exports.de_GetAssignmentCommand = de_GetAssignmentCommand;
800
- const de_GetAssignmentCommandError = async (output, context) => {
801
- const parsedOutput = {
802
- ...output,
803
- body: await parseErrorBody(output.body, context),
804
- };
805
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
806
- switch (errorCode) {
807
- case "RequestError":
808
- case "com.amazonaws.mturk#RequestError":
809
- throw await de_RequestErrorRes(parsedOutput, context);
810
- case "ServiceFault":
811
- case "com.amazonaws.mturk#ServiceFault":
812
- throw await de_ServiceFaultRes(parsedOutput, context);
813
- default:
814
- const parsedBody = parsedOutput.body;
815
- return throwDefaultError({
816
- output,
817
- parsedBody,
818
- errorCode,
819
- });
820
- }
821
- };
822
- const de_GetFileUploadURLCommand = async (output, context) => {
823
- if (output.statusCode >= 300) {
824
- return de_GetFileUploadURLCommandError(output, context);
825
- }
826
- const data = await parseBody(output.body, context);
827
- let contents = {};
828
- contents = (0, smithy_client_1._json)(data);
829
- const response = {
830
- $metadata: deserializeMetadata(output),
831
- ...contents,
832
- };
833
- return response;
834
- };
835
- exports.de_GetFileUploadURLCommand = de_GetFileUploadURLCommand;
836
- const de_GetFileUploadURLCommandError = async (output, context) => {
837
- const parsedOutput = {
838
- ...output,
839
- body: await parseErrorBody(output.body, context),
840
- };
841
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
842
- switch (errorCode) {
843
- case "RequestError":
844
- case "com.amazonaws.mturk#RequestError":
845
- throw await de_RequestErrorRes(parsedOutput, context);
846
- case "ServiceFault":
847
- case "com.amazonaws.mturk#ServiceFault":
848
- throw await de_ServiceFaultRes(parsedOutput, context);
849
- default:
850
- const parsedBody = parsedOutput.body;
851
- return throwDefaultError({
852
- output,
853
- parsedBody,
854
- errorCode,
855
- });
856
- }
857
- };
858
- const de_GetHITCommand = async (output, context) => {
859
- if (output.statusCode >= 300) {
860
- return de_GetHITCommandError(output, context);
861
- }
862
- const data = await parseBody(output.body, context);
863
- let contents = {};
864
- contents = de_GetHITResponse(data, context);
865
- const response = {
866
- $metadata: deserializeMetadata(output),
867
- ...contents,
868
- };
869
- return response;
870
- };
871
- exports.de_GetHITCommand = de_GetHITCommand;
872
- const de_GetHITCommandError = async (output, context) => {
873
- const parsedOutput = {
874
- ...output,
875
- body: await parseErrorBody(output.body, context),
876
- };
877
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
878
- switch (errorCode) {
879
- case "RequestError":
880
- case "com.amazonaws.mturk#RequestError":
881
- throw await de_RequestErrorRes(parsedOutput, context);
882
- case "ServiceFault":
883
- case "com.amazonaws.mturk#ServiceFault":
884
- throw await de_ServiceFaultRes(parsedOutput, context);
885
- default:
886
- const parsedBody = parsedOutput.body;
887
- return throwDefaultError({
888
- output,
889
- parsedBody,
890
- errorCode,
891
- });
892
- }
893
- };
894
- const de_GetQualificationScoreCommand = async (output, context) => {
895
- if (output.statusCode >= 300) {
896
- return de_GetQualificationScoreCommandError(output, context);
897
- }
898
- const data = await parseBody(output.body, context);
899
- let contents = {};
900
- contents = de_GetQualificationScoreResponse(data, context);
901
- const response = {
902
- $metadata: deserializeMetadata(output),
903
- ...contents,
904
- };
905
- return response;
906
- };
907
- exports.de_GetQualificationScoreCommand = de_GetQualificationScoreCommand;
908
- const de_GetQualificationScoreCommandError = async (output, context) => {
909
- const parsedOutput = {
910
- ...output,
911
- body: await parseErrorBody(output.body, context),
912
- };
913
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
914
- switch (errorCode) {
915
- case "RequestError":
916
- case "com.amazonaws.mturk#RequestError":
917
- throw await de_RequestErrorRes(parsedOutput, context);
918
- case "ServiceFault":
919
- case "com.amazonaws.mturk#ServiceFault":
920
- throw await de_ServiceFaultRes(parsedOutput, context);
921
- default:
922
- const parsedBody = parsedOutput.body;
923
- return throwDefaultError({
924
- output,
925
- parsedBody,
926
- errorCode,
927
- });
928
- }
929
- };
930
- const de_GetQualificationTypeCommand = async (output, context) => {
931
- if (output.statusCode >= 300) {
932
- return de_GetQualificationTypeCommandError(output, context);
933
- }
934
- const data = await parseBody(output.body, context);
935
- let contents = {};
936
- contents = de_GetQualificationTypeResponse(data, context);
937
- const response = {
938
- $metadata: deserializeMetadata(output),
939
- ...contents,
940
- };
941
- return response;
942
- };
943
- exports.de_GetQualificationTypeCommand = de_GetQualificationTypeCommand;
944
- const de_GetQualificationTypeCommandError = async (output, context) => {
945
- const parsedOutput = {
946
- ...output,
947
- body: await parseErrorBody(output.body, context),
948
- };
949
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
950
- switch (errorCode) {
951
- case "RequestError":
952
- case "com.amazonaws.mturk#RequestError":
953
- throw await de_RequestErrorRes(parsedOutput, context);
954
- case "ServiceFault":
955
- case "com.amazonaws.mturk#ServiceFault":
956
- throw await de_ServiceFaultRes(parsedOutput, context);
957
- default:
958
- const parsedBody = parsedOutput.body;
959
- return throwDefaultError({
960
- output,
961
- parsedBody,
962
- errorCode,
963
- });
964
- }
965
- };
966
- const de_ListAssignmentsForHITCommand = async (output, context) => {
967
- if (output.statusCode >= 300) {
968
- return de_ListAssignmentsForHITCommandError(output, context);
969
- }
970
- const data = await parseBody(output.body, context);
971
- let contents = {};
972
- contents = de_ListAssignmentsForHITResponse(data, context);
973
- const response = {
974
- $metadata: deserializeMetadata(output),
975
- ...contents,
976
- };
977
- return response;
978
- };
979
- exports.de_ListAssignmentsForHITCommand = de_ListAssignmentsForHITCommand;
980
- const de_ListAssignmentsForHITCommandError = async (output, context) => {
981
- const parsedOutput = {
982
- ...output,
983
- body: await parseErrorBody(output.body, context),
984
- };
985
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
986
- switch (errorCode) {
987
- case "RequestError":
988
- case "com.amazonaws.mturk#RequestError":
989
- throw await de_RequestErrorRes(parsedOutput, context);
990
- case "ServiceFault":
991
- case "com.amazonaws.mturk#ServiceFault":
992
- throw await de_ServiceFaultRes(parsedOutput, context);
993
- default:
994
- const parsedBody = parsedOutput.body;
995
- return throwDefaultError({
996
- output,
997
- parsedBody,
998
- errorCode,
999
- });
1000
- }
1001
- };
1002
- const de_ListBonusPaymentsCommand = async (output, context) => {
1003
- if (output.statusCode >= 300) {
1004
- return de_ListBonusPaymentsCommandError(output, context);
1005
- }
1006
- const data = await parseBody(output.body, context);
1007
- let contents = {};
1008
- contents = de_ListBonusPaymentsResponse(data, context);
1009
- const response = {
1010
- $metadata: deserializeMetadata(output),
1011
- ...contents,
1012
- };
1013
- return response;
1014
- };
1015
- exports.de_ListBonusPaymentsCommand = de_ListBonusPaymentsCommand;
1016
- const de_ListBonusPaymentsCommandError = async (output, context) => {
1017
- const parsedOutput = {
1018
- ...output,
1019
- body: await parseErrorBody(output.body, context),
1020
- };
1021
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1022
- switch (errorCode) {
1023
- case "RequestError":
1024
- case "com.amazonaws.mturk#RequestError":
1025
- throw await de_RequestErrorRes(parsedOutput, context);
1026
- case "ServiceFault":
1027
- case "com.amazonaws.mturk#ServiceFault":
1028
- throw await de_ServiceFaultRes(parsedOutput, context);
1029
- default:
1030
- const parsedBody = parsedOutput.body;
1031
- return throwDefaultError({
1032
- output,
1033
- parsedBody,
1034
- errorCode,
1035
- });
1036
- }
1037
- };
1038
- const de_ListHITsCommand = async (output, context) => {
1039
- if (output.statusCode >= 300) {
1040
- return de_ListHITsCommandError(output, context);
1041
- }
1042
- const data = await parseBody(output.body, context);
1043
- let contents = {};
1044
- contents = de_ListHITsResponse(data, context);
1045
- const response = {
1046
- $metadata: deserializeMetadata(output),
1047
- ...contents,
1048
- };
1049
- return response;
1050
- };
1051
- exports.de_ListHITsCommand = de_ListHITsCommand;
1052
- const de_ListHITsCommandError = async (output, context) => {
1053
- const parsedOutput = {
1054
- ...output,
1055
- body: await parseErrorBody(output.body, context),
1056
- };
1057
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1058
- switch (errorCode) {
1059
- case "RequestError":
1060
- case "com.amazonaws.mturk#RequestError":
1061
- throw await de_RequestErrorRes(parsedOutput, context);
1062
- case "ServiceFault":
1063
- case "com.amazonaws.mturk#ServiceFault":
1064
- throw await de_ServiceFaultRes(parsedOutput, context);
1065
- default:
1066
- const parsedBody = parsedOutput.body;
1067
- return throwDefaultError({
1068
- output,
1069
- parsedBody,
1070
- errorCode,
1071
- });
1072
- }
1073
- };
1074
- const de_ListHITsForQualificationTypeCommand = async (output, context) => {
1075
- if (output.statusCode >= 300) {
1076
- return de_ListHITsForQualificationTypeCommandError(output, context);
1077
- }
1078
- const data = await parseBody(output.body, context);
1079
- let contents = {};
1080
- contents = de_ListHITsForQualificationTypeResponse(data, context);
1081
- const response = {
1082
- $metadata: deserializeMetadata(output),
1083
- ...contents,
1084
- };
1085
- return response;
1086
- };
1087
- exports.de_ListHITsForQualificationTypeCommand = de_ListHITsForQualificationTypeCommand;
1088
- const de_ListHITsForQualificationTypeCommandError = async (output, context) => {
1089
- const parsedOutput = {
1090
- ...output,
1091
- body: await parseErrorBody(output.body, context),
1092
- };
1093
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1094
- switch (errorCode) {
1095
- case "RequestError":
1096
- case "com.amazonaws.mturk#RequestError":
1097
- throw await de_RequestErrorRes(parsedOutput, context);
1098
- case "ServiceFault":
1099
- case "com.amazonaws.mturk#ServiceFault":
1100
- throw await de_ServiceFaultRes(parsedOutput, context);
1101
- default:
1102
- const parsedBody = parsedOutput.body;
1103
- return throwDefaultError({
1104
- output,
1105
- parsedBody,
1106
- errorCode,
1107
- });
1108
- }
1109
- };
1110
- const de_ListQualificationRequestsCommand = async (output, context) => {
1111
- if (output.statusCode >= 300) {
1112
- return de_ListQualificationRequestsCommandError(output, context);
1113
- }
1114
- const data = await parseBody(output.body, context);
1115
- let contents = {};
1116
- contents = de_ListQualificationRequestsResponse(data, context);
1117
- const response = {
1118
- $metadata: deserializeMetadata(output),
1119
- ...contents,
1120
- };
1121
- return response;
1122
- };
1123
- exports.de_ListQualificationRequestsCommand = de_ListQualificationRequestsCommand;
1124
- const de_ListQualificationRequestsCommandError = async (output, context) => {
1125
- const parsedOutput = {
1126
- ...output,
1127
- body: await parseErrorBody(output.body, context),
1128
- };
1129
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1130
- switch (errorCode) {
1131
- case "RequestError":
1132
- case "com.amazonaws.mturk#RequestError":
1133
- throw await de_RequestErrorRes(parsedOutput, context);
1134
- case "ServiceFault":
1135
- case "com.amazonaws.mturk#ServiceFault":
1136
- throw await de_ServiceFaultRes(parsedOutput, context);
1137
- default:
1138
- const parsedBody = parsedOutput.body;
1139
- return throwDefaultError({
1140
- output,
1141
- parsedBody,
1142
- errorCode,
1143
- });
1144
- }
1145
- };
1146
- const de_ListQualificationTypesCommand = async (output, context) => {
1147
- if (output.statusCode >= 300) {
1148
- return de_ListQualificationTypesCommandError(output, context);
1149
- }
1150
- const data = await parseBody(output.body, context);
1151
- let contents = {};
1152
- contents = de_ListQualificationTypesResponse(data, context);
1153
- const response = {
1154
- $metadata: deserializeMetadata(output),
1155
- ...contents,
1156
- };
1157
- return response;
1158
- };
1159
- exports.de_ListQualificationTypesCommand = de_ListQualificationTypesCommand;
1160
- const de_ListQualificationTypesCommandError = async (output, context) => {
1161
- const parsedOutput = {
1162
- ...output,
1163
- body: await parseErrorBody(output.body, context),
1164
- };
1165
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1166
- switch (errorCode) {
1167
- case "RequestError":
1168
- case "com.amazonaws.mturk#RequestError":
1169
- throw await de_RequestErrorRes(parsedOutput, context);
1170
- case "ServiceFault":
1171
- case "com.amazonaws.mturk#ServiceFault":
1172
- throw await de_ServiceFaultRes(parsedOutput, context);
1173
- default:
1174
- const parsedBody = parsedOutput.body;
1175
- return throwDefaultError({
1176
- output,
1177
- parsedBody,
1178
- errorCode,
1179
- });
1180
- }
1181
- };
1182
- const de_ListReviewableHITsCommand = async (output, context) => {
1183
- if (output.statusCode >= 300) {
1184
- return de_ListReviewableHITsCommandError(output, context);
1185
- }
1186
- const data = await parseBody(output.body, context);
1187
- let contents = {};
1188
- contents = de_ListReviewableHITsResponse(data, context);
1189
- const response = {
1190
- $metadata: deserializeMetadata(output),
1191
- ...contents,
1192
- };
1193
- return response;
1194
- };
1195
- exports.de_ListReviewableHITsCommand = de_ListReviewableHITsCommand;
1196
- const de_ListReviewableHITsCommandError = async (output, context) => {
1197
- const parsedOutput = {
1198
- ...output,
1199
- body: await parseErrorBody(output.body, context),
1200
- };
1201
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1202
- switch (errorCode) {
1203
- case "RequestError":
1204
- case "com.amazonaws.mturk#RequestError":
1205
- throw await de_RequestErrorRes(parsedOutput, context);
1206
- case "ServiceFault":
1207
- case "com.amazonaws.mturk#ServiceFault":
1208
- throw await de_ServiceFaultRes(parsedOutput, context);
1209
- default:
1210
- const parsedBody = parsedOutput.body;
1211
- return throwDefaultError({
1212
- output,
1213
- parsedBody,
1214
- errorCode,
1215
- });
1216
- }
1217
- };
1218
- const de_ListReviewPolicyResultsForHITCommand = async (output, context) => {
1219
- if (output.statusCode >= 300) {
1220
- return de_ListReviewPolicyResultsForHITCommandError(output, context);
1221
- }
1222
- const data = await parseBody(output.body, context);
1223
- let contents = {};
1224
- contents = de_ListReviewPolicyResultsForHITResponse(data, context);
1225
- const response = {
1226
- $metadata: deserializeMetadata(output),
1227
- ...contents,
1228
- };
1229
- return response;
1230
- };
1231
- exports.de_ListReviewPolicyResultsForHITCommand = de_ListReviewPolicyResultsForHITCommand;
1232
- const de_ListReviewPolicyResultsForHITCommandError = async (output, context) => {
1233
- const parsedOutput = {
1234
- ...output,
1235
- body: await parseErrorBody(output.body, context),
1236
- };
1237
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1238
- switch (errorCode) {
1239
- case "RequestError":
1240
- case "com.amazonaws.mturk#RequestError":
1241
- throw await de_RequestErrorRes(parsedOutput, context);
1242
- case "ServiceFault":
1243
- case "com.amazonaws.mturk#ServiceFault":
1244
- throw await de_ServiceFaultRes(parsedOutput, context);
1245
- default:
1246
- const parsedBody = parsedOutput.body;
1247
- return throwDefaultError({
1248
- output,
1249
- parsedBody,
1250
- errorCode,
1251
- });
1252
- }
1253
- };
1254
- const de_ListWorkerBlocksCommand = async (output, context) => {
1255
- if (output.statusCode >= 300) {
1256
- return de_ListWorkerBlocksCommandError(output, context);
1257
- }
1258
- const data = await parseBody(output.body, context);
1259
- let contents = {};
1260
- contents = (0, smithy_client_1._json)(data);
1261
- const response = {
1262
- $metadata: deserializeMetadata(output),
1263
- ...contents,
1264
- };
1265
- return response;
1266
- };
1267
- exports.de_ListWorkerBlocksCommand = de_ListWorkerBlocksCommand;
1268
- const de_ListWorkerBlocksCommandError = async (output, context) => {
1269
- const parsedOutput = {
1270
- ...output,
1271
- body: await parseErrorBody(output.body, context),
1272
- };
1273
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1274
- switch (errorCode) {
1275
- case "RequestError":
1276
- case "com.amazonaws.mturk#RequestError":
1277
- throw await de_RequestErrorRes(parsedOutput, context);
1278
- case "ServiceFault":
1279
- case "com.amazonaws.mturk#ServiceFault":
1280
- throw await de_ServiceFaultRes(parsedOutput, context);
1281
- default:
1282
- const parsedBody = parsedOutput.body;
1283
- return throwDefaultError({
1284
- output,
1285
- parsedBody,
1286
- errorCode,
1287
- });
1288
- }
1289
- };
1290
- const de_ListWorkersWithQualificationTypeCommand = async (output, context) => {
1291
- if (output.statusCode >= 300) {
1292
- return de_ListWorkersWithQualificationTypeCommandError(output, context);
1293
- }
1294
- const data = await parseBody(output.body, context);
1295
- let contents = {};
1296
- contents = de_ListWorkersWithQualificationTypeResponse(data, context);
1297
- const response = {
1298
- $metadata: deserializeMetadata(output),
1299
- ...contents,
1300
- };
1301
- return response;
1302
- };
1303
- exports.de_ListWorkersWithQualificationTypeCommand = de_ListWorkersWithQualificationTypeCommand;
1304
- const de_ListWorkersWithQualificationTypeCommandError = async (output, context) => {
1305
- const parsedOutput = {
1306
- ...output,
1307
- body: await parseErrorBody(output.body, context),
1308
- };
1309
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1310
- switch (errorCode) {
1311
- case "RequestError":
1312
- case "com.amazonaws.mturk#RequestError":
1313
- throw await de_RequestErrorRes(parsedOutput, context);
1314
- case "ServiceFault":
1315
- case "com.amazonaws.mturk#ServiceFault":
1316
- throw await de_ServiceFaultRes(parsedOutput, context);
1317
- default:
1318
- const parsedBody = parsedOutput.body;
1319
- return throwDefaultError({
1320
- output,
1321
- parsedBody,
1322
- errorCode,
1323
- });
1324
- }
1325
- };
1326
- const de_NotifyWorkersCommand = async (output, context) => {
1327
- if (output.statusCode >= 300) {
1328
- return de_NotifyWorkersCommandError(output, context);
1329
- }
1330
- const data = await parseBody(output.body, context);
1331
- let contents = {};
1332
- contents = (0, smithy_client_1._json)(data);
1333
- const response = {
1334
- $metadata: deserializeMetadata(output),
1335
- ...contents,
1336
- };
1337
- return response;
1338
- };
1339
- exports.de_NotifyWorkersCommand = de_NotifyWorkersCommand;
1340
- const de_NotifyWorkersCommandError = async (output, context) => {
1341
- const parsedOutput = {
1342
- ...output,
1343
- body: await parseErrorBody(output.body, context),
1344
- };
1345
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1346
- switch (errorCode) {
1347
- case "RequestError":
1348
- case "com.amazonaws.mturk#RequestError":
1349
- throw await de_RequestErrorRes(parsedOutput, context);
1350
- case "ServiceFault":
1351
- case "com.amazonaws.mturk#ServiceFault":
1352
- throw await de_ServiceFaultRes(parsedOutput, context);
1353
- default:
1354
- const parsedBody = parsedOutput.body;
1355
- return throwDefaultError({
1356
- output,
1357
- parsedBody,
1358
- errorCode,
1359
- });
1360
- }
1361
- };
1362
- const de_RejectAssignmentCommand = async (output, context) => {
1363
- if (output.statusCode >= 300) {
1364
- return de_RejectAssignmentCommandError(output, context);
1365
- }
1366
- const data = await parseBody(output.body, context);
1367
- let contents = {};
1368
- contents = (0, smithy_client_1._json)(data);
1369
- const response = {
1370
- $metadata: deserializeMetadata(output),
1371
- ...contents,
1372
- };
1373
- return response;
1374
- };
1375
- exports.de_RejectAssignmentCommand = de_RejectAssignmentCommand;
1376
- const de_RejectAssignmentCommandError = async (output, context) => {
1377
- const parsedOutput = {
1378
- ...output,
1379
- body: await parseErrorBody(output.body, context),
1380
- };
1381
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1382
- switch (errorCode) {
1383
- case "RequestError":
1384
- case "com.amazonaws.mturk#RequestError":
1385
- throw await de_RequestErrorRes(parsedOutput, context);
1386
- case "ServiceFault":
1387
- case "com.amazonaws.mturk#ServiceFault":
1388
- throw await de_ServiceFaultRes(parsedOutput, context);
1389
- default:
1390
- const parsedBody = parsedOutput.body;
1391
- return throwDefaultError({
1392
- output,
1393
- parsedBody,
1394
- errorCode,
1395
- });
1396
- }
1397
- };
1398
- const de_RejectQualificationRequestCommand = async (output, context) => {
1399
- if (output.statusCode >= 300) {
1400
- return de_RejectQualificationRequestCommandError(output, context);
1401
- }
1402
- const data = await parseBody(output.body, context);
1403
- let contents = {};
1404
- contents = (0, smithy_client_1._json)(data);
1405
- const response = {
1406
- $metadata: deserializeMetadata(output),
1407
- ...contents,
1408
- };
1409
- return response;
1410
- };
1411
- exports.de_RejectQualificationRequestCommand = de_RejectQualificationRequestCommand;
1412
- const de_RejectQualificationRequestCommandError = async (output, context) => {
1413
- const parsedOutput = {
1414
- ...output,
1415
- body: await parseErrorBody(output.body, context),
1416
- };
1417
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1418
- switch (errorCode) {
1419
- case "RequestError":
1420
- case "com.amazonaws.mturk#RequestError":
1421
- throw await de_RequestErrorRes(parsedOutput, context);
1422
- case "ServiceFault":
1423
- case "com.amazonaws.mturk#ServiceFault":
1424
- throw await de_ServiceFaultRes(parsedOutput, context);
1425
- default:
1426
- const parsedBody = parsedOutput.body;
1427
- return throwDefaultError({
1428
- output,
1429
- parsedBody,
1430
- errorCode,
1431
- });
1432
- }
1433
- };
1434
- const de_SendBonusCommand = async (output, context) => {
1435
- if (output.statusCode >= 300) {
1436
- return de_SendBonusCommandError(output, context);
1437
- }
1438
- const data = await parseBody(output.body, context);
1439
- let contents = {};
1440
- contents = (0, smithy_client_1._json)(data);
1441
- const response = {
1442
- $metadata: deserializeMetadata(output),
1443
- ...contents,
1444
- };
1445
- return response;
1446
- };
1447
- exports.de_SendBonusCommand = de_SendBonusCommand;
1448
- const de_SendBonusCommandError = async (output, context) => {
1449
- const parsedOutput = {
1450
- ...output,
1451
- body: await parseErrorBody(output.body, context),
1452
- };
1453
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1454
- switch (errorCode) {
1455
- case "RequestError":
1456
- case "com.amazonaws.mturk#RequestError":
1457
- throw await de_RequestErrorRes(parsedOutput, context);
1458
- case "ServiceFault":
1459
- case "com.amazonaws.mturk#ServiceFault":
1460
- throw await de_ServiceFaultRes(parsedOutput, context);
1461
- default:
1462
- const parsedBody = parsedOutput.body;
1463
- return throwDefaultError({
1464
- output,
1465
- parsedBody,
1466
- errorCode,
1467
- });
1468
- }
1469
- };
1470
- const de_SendTestEventNotificationCommand = async (output, context) => {
1471
- if (output.statusCode >= 300) {
1472
- return de_SendTestEventNotificationCommandError(output, context);
1473
- }
1474
- const data = await parseBody(output.body, context);
1475
- let contents = {};
1476
- contents = (0, smithy_client_1._json)(data);
1477
- const response = {
1478
- $metadata: deserializeMetadata(output),
1479
- ...contents,
1480
- };
1481
- return response;
1482
- };
1483
- exports.de_SendTestEventNotificationCommand = de_SendTestEventNotificationCommand;
1484
- const de_SendTestEventNotificationCommandError = async (output, context) => {
1485
- const parsedOutput = {
1486
- ...output,
1487
- body: await parseErrorBody(output.body, context),
1488
- };
1489
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1490
- switch (errorCode) {
1491
- case "RequestError":
1492
- case "com.amazonaws.mturk#RequestError":
1493
- throw await de_RequestErrorRes(parsedOutput, context);
1494
- case "ServiceFault":
1495
- case "com.amazonaws.mturk#ServiceFault":
1496
- throw await de_ServiceFaultRes(parsedOutput, context);
1497
- default:
1498
- const parsedBody = parsedOutput.body;
1499
- return throwDefaultError({
1500
- output,
1501
- parsedBody,
1502
- errorCode,
1503
- });
1504
- }
1505
- };
1506
- const de_UpdateExpirationForHITCommand = async (output, context) => {
1507
- if (output.statusCode >= 300) {
1508
- return de_UpdateExpirationForHITCommandError(output, context);
1509
- }
1510
- const data = await parseBody(output.body, context);
1511
- let contents = {};
1512
- contents = (0, smithy_client_1._json)(data);
1513
- const response = {
1514
- $metadata: deserializeMetadata(output),
1515
- ...contents,
1516
- };
1517
- return response;
1518
- };
1519
- exports.de_UpdateExpirationForHITCommand = de_UpdateExpirationForHITCommand;
1520
- const de_UpdateExpirationForHITCommandError = async (output, context) => {
1521
- const parsedOutput = {
1522
- ...output,
1523
- body: await parseErrorBody(output.body, context),
1524
- };
1525
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1526
- switch (errorCode) {
1527
- case "RequestError":
1528
- case "com.amazonaws.mturk#RequestError":
1529
- throw await de_RequestErrorRes(parsedOutput, context);
1530
- case "ServiceFault":
1531
- case "com.amazonaws.mturk#ServiceFault":
1532
- throw await de_ServiceFaultRes(parsedOutput, context);
1533
- default:
1534
- const parsedBody = parsedOutput.body;
1535
- return throwDefaultError({
1536
- output,
1537
- parsedBody,
1538
- errorCode,
1539
- });
1540
- }
1541
- };
1542
- const de_UpdateHITReviewStatusCommand = async (output, context) => {
1543
- if (output.statusCode >= 300) {
1544
- return de_UpdateHITReviewStatusCommandError(output, context);
1545
- }
1546
- const data = await parseBody(output.body, context);
1547
- let contents = {};
1548
- contents = (0, smithy_client_1._json)(data);
1549
- const response = {
1550
- $metadata: deserializeMetadata(output),
1551
- ...contents,
1552
- };
1553
- return response;
1554
- };
1555
- exports.de_UpdateHITReviewStatusCommand = de_UpdateHITReviewStatusCommand;
1556
- const de_UpdateHITReviewStatusCommandError = async (output, context) => {
1557
- const parsedOutput = {
1558
- ...output,
1559
- body: await parseErrorBody(output.body, context),
1560
- };
1561
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1562
- switch (errorCode) {
1563
- case "RequestError":
1564
- case "com.amazonaws.mturk#RequestError":
1565
- throw await de_RequestErrorRes(parsedOutput, context);
1566
- case "ServiceFault":
1567
- case "com.amazonaws.mturk#ServiceFault":
1568
- throw await de_ServiceFaultRes(parsedOutput, context);
1569
- default:
1570
- const parsedBody = parsedOutput.body;
1571
- return throwDefaultError({
1572
- output,
1573
- parsedBody,
1574
- errorCode,
1575
- });
1576
- }
1577
- };
1578
- const de_UpdateHITTypeOfHITCommand = async (output, context) => {
1579
- if (output.statusCode >= 300) {
1580
- return de_UpdateHITTypeOfHITCommandError(output, context);
1581
- }
1582
- const data = await parseBody(output.body, context);
1583
- let contents = {};
1584
- contents = (0, smithy_client_1._json)(data);
1585
- const response = {
1586
- $metadata: deserializeMetadata(output),
1587
- ...contents,
1588
- };
1589
- return response;
1590
- };
1591
- exports.de_UpdateHITTypeOfHITCommand = de_UpdateHITTypeOfHITCommand;
1592
- const de_UpdateHITTypeOfHITCommandError = async (output, context) => {
1593
- const parsedOutput = {
1594
- ...output,
1595
- body: await parseErrorBody(output.body, context),
1596
- };
1597
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1598
- switch (errorCode) {
1599
- case "RequestError":
1600
- case "com.amazonaws.mturk#RequestError":
1601
- throw await de_RequestErrorRes(parsedOutput, context);
1602
- case "ServiceFault":
1603
- case "com.amazonaws.mturk#ServiceFault":
1604
- throw await de_ServiceFaultRes(parsedOutput, context);
1605
- default:
1606
- const parsedBody = parsedOutput.body;
1607
- return throwDefaultError({
1608
- output,
1609
- parsedBody,
1610
- errorCode,
1611
- });
1612
- }
1613
- };
1614
- const de_UpdateNotificationSettingsCommand = async (output, context) => {
1615
- if (output.statusCode >= 300) {
1616
- return de_UpdateNotificationSettingsCommandError(output, context);
1617
- }
1618
- const data = await parseBody(output.body, context);
1619
- let contents = {};
1620
- contents = (0, smithy_client_1._json)(data);
1621
- const response = {
1622
- $metadata: deserializeMetadata(output),
1623
- ...contents,
1624
- };
1625
- return response;
1626
- };
1627
- exports.de_UpdateNotificationSettingsCommand = de_UpdateNotificationSettingsCommand;
1628
- const de_UpdateNotificationSettingsCommandError = async (output, context) => {
1629
- const parsedOutput = {
1630
- ...output,
1631
- body: await parseErrorBody(output.body, context),
1632
- };
1633
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1634
- switch (errorCode) {
1635
- case "RequestError":
1636
- case "com.amazonaws.mturk#RequestError":
1637
- throw await de_RequestErrorRes(parsedOutput, context);
1638
- case "ServiceFault":
1639
- case "com.amazonaws.mturk#ServiceFault":
1640
- throw await de_ServiceFaultRes(parsedOutput, context);
1641
- default:
1642
- const parsedBody = parsedOutput.body;
1643
- return throwDefaultError({
1644
- output,
1645
- parsedBody,
1646
- errorCode,
1647
- });
1648
- }
1649
- };
1650
- const de_UpdateQualificationTypeCommand = async (output, context) => {
1651
- if (output.statusCode >= 300) {
1652
- return de_UpdateQualificationTypeCommandError(output, context);
1653
- }
1654
- const data = await parseBody(output.body, context);
1655
- let contents = {};
1656
- contents = de_UpdateQualificationTypeResponse(data, context);
1657
- const response = {
1658
- $metadata: deserializeMetadata(output),
1659
- ...contents,
1660
- };
1661
- return response;
1662
- };
1663
- exports.de_UpdateQualificationTypeCommand = de_UpdateQualificationTypeCommand;
1664
- const de_UpdateQualificationTypeCommandError = async (output, context) => {
1665
- const parsedOutput = {
1666
- ...output,
1667
- body: await parseErrorBody(output.body, context),
1668
- };
1669
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1670
- switch (errorCode) {
1671
- case "RequestError":
1672
- case "com.amazonaws.mturk#RequestError":
1673
- throw await de_RequestErrorRes(parsedOutput, context);
1674
- case "ServiceFault":
1675
- case "com.amazonaws.mturk#ServiceFault":
1676
- throw await de_ServiceFaultRes(parsedOutput, context);
1677
- default:
1678
- const parsedBody = parsedOutput.body;
1679
- return throwDefaultError({
1680
- output,
1681
- parsedBody,
1682
- errorCode,
1683
- });
1684
- }
1685
- };
1686
- const de_RequestErrorRes = async (parsedOutput, context) => {
1687
- const body = parsedOutput.body;
1688
- const deserialized = (0, smithy_client_1._json)(body);
1689
- const exception = new models_0_1.RequestError({
1690
- $metadata: deserializeMetadata(parsedOutput),
1691
- ...deserialized,
1692
- });
1693
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1694
- };
1695
- const de_ServiceFaultRes = async (parsedOutput, context) => {
1696
- const body = parsedOutput.body;
1697
- const deserialized = (0, smithy_client_1._json)(body);
1698
- const exception = new models_0_1.ServiceFault({
1699
- $metadata: deserializeMetadata(parsedOutput),
1700
- ...deserialized,
1701
- });
1702
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1703
- };
1704
- const se_UpdateExpirationForHITRequest = (input, context) => {
1705
- return (0, smithy_client_1.take)(input, {
1706
- ExpireAt: (_) => Math.round(_.getTime() / 1000),
1707
- HITId: [],
1708
- });
1709
- };
1710
- const de_Assignment = (output, context) => {
1711
- return (0, smithy_client_1.take)(output, {
1712
- AcceptTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1713
- Answer: smithy_client_1.expectString,
1714
- ApprovalTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1715
- AssignmentId: smithy_client_1.expectString,
1716
- AssignmentStatus: smithy_client_1.expectString,
1717
- AutoApprovalTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1718
- Deadline: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1719
- HITId: smithy_client_1.expectString,
1720
- RejectionTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1721
- RequesterFeedback: smithy_client_1.expectString,
1722
- SubmitTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1723
- WorkerId: smithy_client_1.expectString,
1724
- });
1725
- };
1726
- const de_AssignmentList = (output, context) => {
1727
- const retVal = (output || [])
1728
- .filter((e) => e != null)
1729
- .map((entry) => {
1730
- return de_Assignment(entry, context);
1731
- });
1732
- return retVal;
1733
- };
1734
- const de_BonusPayment = (output, context) => {
1735
- return (0, smithy_client_1.take)(output, {
1736
- AssignmentId: smithy_client_1.expectString,
1737
- BonusAmount: smithy_client_1.expectString,
1738
- GrantTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1739
- Reason: smithy_client_1.expectString,
1740
- WorkerId: smithy_client_1.expectString,
1741
- });
1742
- };
1743
- const de_BonusPaymentList = (output, context) => {
1744
- const retVal = (output || [])
1745
- .filter((e) => e != null)
1746
- .map((entry) => {
1747
- return de_BonusPayment(entry, context);
1748
- });
1749
- return retVal;
1750
- };
1751
- const de_CreateHITResponse = (output, context) => {
1752
- return (0, smithy_client_1.take)(output, {
1753
- HIT: (_) => de_HIT(_, context),
1754
- });
1755
- };
1756
- const de_CreateHITWithHITTypeResponse = (output, context) => {
1757
- return (0, smithy_client_1.take)(output, {
1758
- HIT: (_) => de_HIT(_, context),
1759
- });
1760
- };
1761
- const de_CreateQualificationTypeResponse = (output, context) => {
1762
- return (0, smithy_client_1.take)(output, {
1763
- QualificationType: (_) => de_QualificationType(_, context),
1764
- });
1765
- };
1766
- const de_GetAssignmentResponse = (output, context) => {
1767
- return (0, smithy_client_1.take)(output, {
1768
- Assignment: (_) => de_Assignment(_, context),
1769
- HIT: (_) => de_HIT(_, context),
1770
- });
1771
- };
1772
- const de_GetHITResponse = (output, context) => {
1773
- return (0, smithy_client_1.take)(output, {
1774
- HIT: (_) => de_HIT(_, context),
1775
- });
1776
- };
1777
- const de_GetQualificationScoreResponse = (output, context) => {
1778
- return (0, smithy_client_1.take)(output, {
1779
- Qualification: (_) => de_Qualification(_, context),
1780
- });
1781
- };
1782
- const de_GetQualificationTypeResponse = (output, context) => {
1783
- return (0, smithy_client_1.take)(output, {
1784
- QualificationType: (_) => de_QualificationType(_, context),
1785
- });
1786
- };
1787
- const de_HIT = (output, context) => {
1788
- return (0, smithy_client_1.take)(output, {
1789
- AssignmentDurationInSeconds: smithy_client_1.expectLong,
1790
- AutoApprovalDelayInSeconds: smithy_client_1.expectLong,
1791
- CreationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1792
- Description: smithy_client_1.expectString,
1793
- Expiration: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1794
- HITGroupId: smithy_client_1.expectString,
1795
- HITId: smithy_client_1.expectString,
1796
- HITLayoutId: smithy_client_1.expectString,
1797
- HITReviewStatus: smithy_client_1.expectString,
1798
- HITStatus: smithy_client_1.expectString,
1799
- HITTypeId: smithy_client_1.expectString,
1800
- Keywords: smithy_client_1.expectString,
1801
- MaxAssignments: smithy_client_1.expectInt32,
1802
- NumberOfAssignmentsAvailable: smithy_client_1.expectInt32,
1803
- NumberOfAssignmentsCompleted: smithy_client_1.expectInt32,
1804
- NumberOfAssignmentsPending: smithy_client_1.expectInt32,
1805
- QualificationRequirements: smithy_client_1._json,
1806
- Question: smithy_client_1.expectString,
1807
- RequesterAnnotation: smithy_client_1.expectString,
1808
- Reward: smithy_client_1.expectString,
1809
- Title: smithy_client_1.expectString,
1810
- });
1811
- };
1812
- const de_HITList = (output, context) => {
1813
- const retVal = (output || [])
1814
- .filter((e) => e != null)
1815
- .map((entry) => {
1816
- return de_HIT(entry, context);
1817
- });
1818
- return retVal;
1819
- };
1820
- const de_ListAssignmentsForHITResponse = (output, context) => {
1821
- return (0, smithy_client_1.take)(output, {
1822
- Assignments: (_) => de_AssignmentList(_, context),
1823
- NextToken: smithy_client_1.expectString,
1824
- NumResults: smithy_client_1.expectInt32,
1825
- });
1826
- };
1827
- const de_ListBonusPaymentsResponse = (output, context) => {
1828
- return (0, smithy_client_1.take)(output, {
1829
- BonusPayments: (_) => de_BonusPaymentList(_, context),
1830
- NextToken: smithy_client_1.expectString,
1831
- NumResults: smithy_client_1.expectInt32,
1832
- });
1833
- };
1834
- const de_ListHITsForQualificationTypeResponse = (output, context) => {
1835
- return (0, smithy_client_1.take)(output, {
1836
- HITs: (_) => de_HITList(_, context),
1837
- NextToken: smithy_client_1.expectString,
1838
- NumResults: smithy_client_1.expectInt32,
1839
- });
1840
- };
1841
- const de_ListHITsResponse = (output, context) => {
1842
- return (0, smithy_client_1.take)(output, {
1843
- HITs: (_) => de_HITList(_, context),
1844
- NextToken: smithy_client_1.expectString,
1845
- NumResults: smithy_client_1.expectInt32,
1846
- });
1847
- };
1848
- const de_ListQualificationRequestsResponse = (output, context) => {
1849
- return (0, smithy_client_1.take)(output, {
1850
- NextToken: smithy_client_1.expectString,
1851
- NumResults: smithy_client_1.expectInt32,
1852
- QualificationRequests: (_) => de_QualificationRequestList(_, context),
1853
- });
1854
- };
1855
- const de_ListQualificationTypesResponse = (output, context) => {
1856
- return (0, smithy_client_1.take)(output, {
1857
- NextToken: smithy_client_1.expectString,
1858
- NumResults: smithy_client_1.expectInt32,
1859
- QualificationTypes: (_) => de_QualificationTypeList(_, context),
1860
- });
1861
- };
1862
- const de_ListReviewableHITsResponse = (output, context) => {
1863
- return (0, smithy_client_1.take)(output, {
1864
- HITs: (_) => de_HITList(_, context),
1865
- NextToken: smithy_client_1.expectString,
1866
- NumResults: smithy_client_1.expectInt32,
1867
- });
1868
- };
1869
- const de_ListReviewPolicyResultsForHITResponse = (output, context) => {
1870
- return (0, smithy_client_1.take)(output, {
1871
- AssignmentReviewPolicy: smithy_client_1._json,
1872
- AssignmentReviewReport: (_) => de_ReviewReport(_, context),
1873
- HITId: smithy_client_1.expectString,
1874
- HITReviewPolicy: smithy_client_1._json,
1875
- HITReviewReport: (_) => de_ReviewReport(_, context),
1876
- NextToken: smithy_client_1.expectString,
1877
- });
1878
- };
1879
- const de_ListWorkersWithQualificationTypeResponse = (output, context) => {
1880
- return (0, smithy_client_1.take)(output, {
1881
- NextToken: smithy_client_1.expectString,
1882
- NumResults: smithy_client_1.expectInt32,
1883
- Qualifications: (_) => de_QualificationList(_, context),
1884
- });
1885
- };
1886
- const de_Qualification = (output, context) => {
1887
- return (0, smithy_client_1.take)(output, {
1888
- GrantTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1889
- IntegerValue: smithy_client_1.expectInt32,
1890
- LocaleValue: smithy_client_1._json,
1891
- QualificationTypeId: smithy_client_1.expectString,
1892
- Status: smithy_client_1.expectString,
1893
- WorkerId: smithy_client_1.expectString,
1894
- });
1895
- };
1896
- const de_QualificationList = (output, context) => {
1897
- const retVal = (output || [])
1898
- .filter((e) => e != null)
1899
- .map((entry) => {
1900
- return de_Qualification(entry, context);
1901
- });
1902
- return retVal;
1903
- };
1904
- const de_QualificationRequest = (output, context) => {
1905
- return (0, smithy_client_1.take)(output, {
1906
- Answer: smithy_client_1.expectString,
1907
- QualificationRequestId: smithy_client_1.expectString,
1908
- QualificationTypeId: smithy_client_1.expectString,
1909
- SubmitTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1910
- Test: smithy_client_1.expectString,
1911
- WorkerId: smithy_client_1.expectString,
1912
- });
1913
- };
1914
- const de_QualificationRequestList = (output, context) => {
1915
- const retVal = (output || [])
1916
- .filter((e) => e != null)
1917
- .map((entry) => {
1918
- return de_QualificationRequest(entry, context);
1919
- });
1920
- return retVal;
1921
- };
1922
- const de_QualificationType = (output, context) => {
1923
- return (0, smithy_client_1.take)(output, {
1924
- AnswerKey: smithy_client_1.expectString,
1925
- AutoGranted: smithy_client_1.expectBoolean,
1926
- AutoGrantedValue: smithy_client_1.expectInt32,
1927
- CreationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1928
- Description: smithy_client_1.expectString,
1929
- IsRequestable: smithy_client_1.expectBoolean,
1930
- Keywords: smithy_client_1.expectString,
1931
- Name: smithy_client_1.expectString,
1932
- QualificationTypeId: smithy_client_1.expectString,
1933
- QualificationTypeStatus: smithy_client_1.expectString,
1934
- RetryDelayInSeconds: smithy_client_1.expectLong,
1935
- Test: smithy_client_1.expectString,
1936
- TestDurationInSeconds: smithy_client_1.expectLong,
1937
- });
1938
- };
1939
- const de_QualificationTypeList = (output, context) => {
1940
- const retVal = (output || [])
1941
- .filter((e) => e != null)
1942
- .map((entry) => {
1943
- return de_QualificationType(entry, context);
1944
- });
1945
- return retVal;
1946
- };
1947
- const de_ReviewActionDetail = (output, context) => {
1948
- return (0, smithy_client_1.take)(output, {
1949
- ActionId: smithy_client_1.expectString,
1950
- ActionName: smithy_client_1.expectString,
1951
- CompleteTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1952
- ErrorCode: smithy_client_1.expectString,
1953
- Result: smithy_client_1.expectString,
1954
- Status: smithy_client_1.expectString,
1955
- TargetId: smithy_client_1.expectString,
1956
- TargetType: smithy_client_1.expectString,
1957
- });
1958
- };
1959
- const de_ReviewActionDetailList = (output, context) => {
1960
- const retVal = (output || [])
1961
- .filter((e) => e != null)
1962
- .map((entry) => {
1963
- return de_ReviewActionDetail(entry, context);
1964
- });
1965
- return retVal;
1966
- };
1967
- const de_ReviewReport = (output, context) => {
1968
- return (0, smithy_client_1.take)(output, {
1969
- ReviewActions: (_) => de_ReviewActionDetailList(_, context),
1970
- ReviewResults: smithy_client_1._json,
1971
- });
1972
- };
1973
- const de_UpdateQualificationTypeResponse = (output, context) => {
1974
- return (0, smithy_client_1.take)(output, {
1975
- QualificationType: (_) => de_QualificationType(_, context),
1976
- });
1977
- };
1978
- const deserializeMetadata = (output) => ({
1979
- httpStatusCode: output.statusCode,
1980
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1981
- extendedRequestId: output.headers["x-amz-id-2"],
1982
- cfId: output.headers["x-amz-cf-id"],
1983
- });
1984
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1985
- const throwDefaultError = (0, smithy_client_1.withBaseException)(MTurkServiceException_1.MTurkServiceException);
1986
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1987
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1988
- const contents = {
1989
- protocol,
1990
- hostname,
1991
- port,
1992
- method: "POST",
1993
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1994
- headers,
1995
- };
1996
- if (resolvedHostname !== undefined) {
1997
- contents.hostname = resolvedHostname;
1998
- }
1999
- if (body !== undefined) {
2000
- contents.body = body;
2001
- }
2002
- return new protocol_http_1.HttpRequest(contents);
2003
- };
2004
- function sharedHeaders(operation) {
2005
- return {
2006
- "content-type": "application/x-amz-json-1.1",
2007
- "x-amz-target": `MTurkRequesterServiceV20170117.${operation}`,
2008
- };
2009
- }
2010
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2011
- if (encoded.length) {
2012
- return JSON.parse(encoded);
2013
- }
2014
- return {};
2015
- });
2016
- const parseErrorBody = async (errorBody, context) => {
2017
- const value = await parseBody(errorBody, context);
2018
- value.message = value.message ?? value.Message;
2019
- return value;
2020
- };
2021
- const loadRestJsonErrorCode = (output, data) => {
2022
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2023
- const sanitizeErrorCode = (rawValue) => {
2024
- let cleanValue = rawValue;
2025
- if (typeof cleanValue === "number") {
2026
- cleanValue = cleanValue.toString();
2027
- }
2028
- if (cleanValue.indexOf(",") >= 0) {
2029
- cleanValue = cleanValue.split(",")[0];
2030
- }
2031
- if (cleanValue.indexOf(":") >= 0) {
2032
- cleanValue = cleanValue.split(":")[0];
2033
- }
2034
- if (cleanValue.indexOf("#") >= 0) {
2035
- cleanValue = cleanValue.split("#")[1];
2036
- }
2037
- return cleanValue;
2038
- };
2039
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2040
- if (headerKey !== undefined) {
2041
- return sanitizeErrorCode(output.headers[headerKey]);
2042
- }
2043
- if (data.code !== undefined) {
2044
- return sanitizeErrorCode(data.code);
2045
- }
2046
- if (data["__type"] !== undefined) {
2047
- return sanitizeErrorCode(data["__type"]);
2048
- }
2049
- };
1
+ module.exports = require("../index.js");