rejectAssignment method
The RejectAssignment
operation rejects the results of a
completed assignment.
You can include an optional feedback message with the rejection, which the Worker can see in the Status section of the web site. When you include a feedback message with the rejection, it helps the Worker understand why the assignment was rejected, and can improve the quality of the results the Worker submits in the future.
Only the Requester who created the HIT can reject an assignment for the HIT.
May throw ServiceFault. May throw RequestError.
Parameter assignmentId
:
The ID of the assignment. The assignment must correspond to a HIT created
by the Requester.
Parameter requesterFeedback
:
A message for the Worker, which the Worker can see in the Status section
of the web site.
Implementation
Future<void> rejectAssignment({
required String assignmentId,
required String requesterFeedback,
}) async {
ArgumentError.checkNotNull(assignmentId, 'assignmentId');
_s.validateStringLength(
'assignmentId',
assignmentId,
1,
64,
isRequired: true,
);
ArgumentError.checkNotNull(requesterFeedback, 'requesterFeedback');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'MTurkRequesterServiceV20170117.RejectAssignment'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AssignmentId': assignmentId,
'RequesterFeedback': requesterFeedback,
},
);
}