listHITsForQualificationType method

Future<ListHITsForQualificationTypeResponse> listHITsForQualificationType({
  1. required String qualificationTypeId,
  2. int? maxResults,
  3. String? nextToken,
})

The ListHITsForQualificationType operation returns the HITs that use the given Qualification type for a Qualification requirement. The operation returns HITs of any status, except for HITs that have been deleted with the DeleteHIT operation or that have been auto-deleted.

May throw ServiceFault. May throw RequestError.

Parameter qualificationTypeId : The ID of the Qualification type to use when querying HITs.

Parameter maxResults : Limit the number of results returned.

Parameter nextToken : Pagination Token

Implementation

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

  return ListHITsForQualificationTypeResponse.fromJson(jsonResponse.body);
}