associateQualificationWithWorker method
The AssociateQualificationWithWorker operation gives a Worker
a Qualification. AssociateQualificationWithWorker does not
require that the Worker submit a Qualification request. It gives the
Qualification directly to the Worker.
You can only assign a Qualification of a Qualification type that you
created (using the CreateQualificationType operation).
May throw RequestError.
May throw ServiceFault.
Parameter qualificationTypeId :
The ID of the Qualification type to use for the assigned Qualification.
Parameter workerId :
The ID of the Worker to whom the Qualification is being assigned. Worker
IDs are included with submitted HIT assignments and Qualification
requests.
Parameter integerValue :
The value of the Qualification to assign.
Parameter sendNotification :
Specifies whether to send a notification email message to the Worker
saying that the qualification was assigned to the Worker. Note: this is
true by default.
Implementation
Future<void> associateQualificationWithWorker({
required String qualificationTypeId,
required String workerId,
int? integerValue,
bool? sendNotification,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'MTurkRequesterServiceV20170117.AssociateQualificationWithWorker'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'QualificationTypeId': qualificationTypeId,
'WorkerId': workerId,
if (integerValue != null) 'IntegerValue': integerValue,
if (sendNotification != null) 'SendNotification': sendNotification,
},
);
}