listThingRegistrationTaskReports method

Future<ListThingRegistrationTaskReportsResponse> listThingRegistrationTaskReports({
  1. required ReportType reportType,
  2. required String taskId,
  3. int? maxResults,
  4. String? nextToken,
})

Information about the thing registration tasks.

May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw InternalFailureException.

Parameter reportType : The type of task report.

Parameter taskId : The id of the task.

Parameter maxResults : The maximum number of results to return per request.

Parameter nextToken : To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

Implementation

Future<ListThingRegistrationTaskReportsResponse>
    listThingRegistrationTaskReports({
  required ReportType reportType,
  required String taskId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(reportType, 'reportType');
  ArgumentError.checkNotNull(taskId, 'taskId');
  _s.validateStringLength(
    'taskId',
    taskId,
    0,
    40,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final $query = <String, List<String>>{
    'reportType': [reportType.toValue()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/thing-registration-tasks/${Uri.encodeComponent(taskId)}/reports',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListThingRegistrationTaskReportsResponse.fromJson(response);
}