listQualificationTypes method

Future<ListQualificationTypesResponse> listQualificationTypes({
  1. required bool mustBeRequestable,
  2. int? maxResults,
  3. bool? mustBeOwnedByCaller,
  4. String? nextToken,
  5. String? query,
})

The ListQualificationTypes operation returns a list of Qualification types, filtered by an optional search term.

May throw ServiceFault. May throw RequestError.

Parameter mustBeRequestable : Specifies that only Qualification types that a user can request through the Amazon Mechanical Turk web site, such as by taking a Qualification test, are returned as results of the search. Some Qualification types, such as those assigned automatically by the system, cannot be requested directly by users. If false, all Qualification types, including those managed by the system, are considered. Valid values are True | False.

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

Parameter mustBeOwnedByCaller : Specifies that only Qualification types that the Requester created are returned. If false, the operation returns all Qualification types.

Parameter query : A text query against all of the searchable attributes of Qualification types.

Implementation

Future<ListQualificationTypesResponse> listQualificationTypes({
  required bool mustBeRequestable,
  int? maxResults,
  bool? mustBeOwnedByCaller,
  String? nextToken,
  String? query,
}) async {
  ArgumentError.checkNotNull(mustBeRequestable, 'mustBeRequestable');
  _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.ListQualificationTypes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MustBeRequestable': mustBeRequestable,
      if (maxResults != null) 'MaxResults': maxResults,
      if (mustBeOwnedByCaller != null)
        'MustBeOwnedByCaller': mustBeOwnedByCaller,
      if (nextToken != null) 'NextToken': nextToken,
      if (query != null) 'Query': query,
    },
  );

  return ListQualificationTypesResponse.fromJson(jsonResponse.body);
}