listDataSourceSyncJobs method

Future<ListDataSourceSyncJobsResponse> listDataSourceSyncJobs({
  1. required String id,
  2. required String indexId,
  3. int? maxResults,
  4. String? nextToken,
  5. TimeRange? startTimeFilter,
  6. DataSourceSyncJobStatus? statusFilter,
})

Gets statistics about synchronizing a data source connector.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter id : The identifier of the data source connector.

Parameter indexId : The identifier of the index used with the data source connector.

Parameter maxResults : The maximum number of synchronization jobs to return in the response. If there are fewer results in the list, this response contains only the actual results.

Parameter nextToken : If the previous response was incomplete (because there is more data to retrieve), Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of jobs.

Parameter startTimeFilter : When specified, the synchronization jobs returned in the list are limited to jobs between the specified dates.

Parameter statusFilter : Only returns synchronization jobs with the Status field equal to the specified status.

Implementation

Future<ListDataSourceSyncJobsResponse> listDataSourceSyncJobs({
  required String id,
  required String indexId,
  int? maxResults,
  String? nextToken,
  TimeRange? startTimeFilter,
  DataSourceSyncJobStatus? statusFilter,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.ListDataSourceSyncJobs'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      'IndexId': indexId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (startTimeFilter != null) 'StartTimeFilter': startTimeFilter,
      if (statusFilter != null) 'StatusFilter': statusFilter.value,
    },
  );

  return ListDataSourceSyncJobsResponse.fromJson(jsonResponse.body);
}