listReviewPolicyResultsForHIT method

Future<ListReviewPolicyResultsForHITResponse> listReviewPolicyResultsForHIT({
  1. required String hITId,
  2. int? maxResults,
  3. String? nextToken,
  4. List<ReviewPolicyLevel>? policyLevels,
  5. bool? retrieveActions,
  6. bool? retrieveResults,
})

The ListReviewPolicyResultsForHIT operation retrieves the computed results and the actions taken in the course of executing your Review Policies for a given HIT. For information about how to specify Review Policies when you call CreateHIT, see Review Policies. The ListReviewPolicyResultsForHIT operation can return results for both Assignment-level and HIT-level review results.

May throw ServiceFault. May throw RequestError.

Parameter hITId : The unique identifier of the HIT to retrieve review results for.

Parameter maxResults : Limit the number of results returned.

Parameter nextToken : Pagination token

Parameter policyLevels : The Policy Level(s) to retrieve review results for - HIT or Assignment. If omitted, the default behavior is to retrieve all data for both policy levels. For a list of all the described policies, see Review Policies.

Parameter retrieveActions : Specify if the operation should retrieve a list of the actions taken executing the Review Policies and their outcomes.

Parameter retrieveResults : Specify if the operation should retrieve a list of the results computed by the Review Policies.

Implementation

Future<ListReviewPolicyResultsForHITResponse> listReviewPolicyResultsForHIT({
  required String hITId,
  int? maxResults,
  String? nextToken,
  List<ReviewPolicyLevel>? policyLevels,
  bool? retrieveActions,
  bool? retrieveResults,
}) async {
  ArgumentError.checkNotNull(hITId, 'hITId');
  _s.validateStringLength(
    'hITId',
    hITId,
    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.ListReviewPolicyResultsForHIT'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HITId': hITId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (policyLevels != null)
        'PolicyLevels': policyLevels.map((e) => e.toValue()).toList(),
      if (retrieveActions != null) 'RetrieveActions': retrieveActions,
      if (retrieveResults != null) 'RetrieveResults': retrieveResults,
    },
  );

  return ListReviewPolicyResultsForHITResponse.fromJson(jsonResponse.body);
}