getQualificationScore method

Future<GetQualificationScoreResponse> getQualificationScore({
  1. required String qualificationTypeId,
  2. required String workerId,
})

The GetQualificationScore operation returns the value of a Worker's Qualification for a given Qualification type.

To get a Worker's Qualification, you must know the Worker's ID. The Worker's ID is included in the assignment data returned by the ListAssignmentsForHIT operation.

Only the owner of a Qualification type can query the value of a Worker's Qualification of that type.

May throw ServiceFault. May throw RequestError.

Parameter qualificationTypeId : The ID of the QualificationType.

Parameter workerId : The ID of the Worker whose Qualification is being updated.

Implementation

Future<GetQualificationScoreResponse> getQualificationScore({
  required String qualificationTypeId,
  required String workerId,
}) async {
  ArgumentError.checkNotNull(qualificationTypeId, 'qualificationTypeId');
  _s.validateStringLength(
    'qualificationTypeId',
    qualificationTypeId,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(workerId, 'workerId');
  _s.validateStringLength(
    'workerId',
    workerId,
    1,
    64,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MTurkRequesterServiceV20170117.GetQualificationScore'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QualificationTypeId': qualificationTypeId,
      'WorkerId': workerId,
    },
  );

  return GetQualificationScoreResponse.fromJson(jsonResponse.body);
}