rejectQualificationRequest method

Future<void> rejectQualificationRequest({
  1. required String qualificationRequestId,
  2. String? reason,
})

The RejectQualificationRequest operation rejects a user's request for a Qualification.

You can provide a text message explaining why the request was rejected. The Worker who made the request can see this message.

May throw ServiceFault. May throw RequestError.

Parameter qualificationRequestId : The ID of the Qualification request, as returned by the ListQualificationRequests operation.

Parameter reason : A text message explaining why the request was rejected, to be shown to the Worker who made the request.

Implementation

Future<void> rejectQualificationRequest({
  required String qualificationRequestId,
  String? reason,
}) async {
  ArgumentError.checkNotNull(
      qualificationRequestId, 'qualificationRequestId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'MTurkRequesterServiceV20170117.RejectQualificationRequest'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QualificationRequestId': qualificationRequestId,
      if (reason != null) 'Reason': reason,
    },
  );
}