listQualificationRequests method

Future<ListQualificationRequestsResponse> listQualificationRequests({
  1. int? maxResults,
  2. String? nextToken,
  3. String? qualificationTypeId,
})

The ListQualificationRequests operation retrieves requests for Qualifications of a particular Qualification type. The owner of the Qualification type calls this operation to poll for pending requests, and accepts them using the AcceptQualification operation.

May throw ServiceFault. May throw RequestError.

Parameter maxResults : The maximum number of results to return in a single call.

Parameter qualificationTypeId : The ID of the QualificationType.

Implementation

Future<ListQualificationRequestsResponse> listQualificationRequests({
  int? maxResults,
  String? nextToken,
  String? qualificationTypeId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    255,
  );
  _s.validateStringLength(
    'qualificationTypeId',
    qualificationTypeId,
    1,
    64,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MTurkRequesterServiceV20170117.ListQualificationRequests'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (qualificationTypeId != null)
        'QualificationTypeId': qualificationTypeId,
    },
  );

  return ListQualificationRequestsResponse.fromJson(jsonResponse.body);
}